{"id":16184307,"url":"https://github.com/mattmezza/msgdown","last_synced_at":"2025-03-19T02:31:10.441Z","repository":{"id":33431538,"uuid":"158374571","full_name":"mattmezza/msgdown","owner":"mattmezza","description":"*Simple* /messages/, _formatted_.","archived":false,"fork":false,"pushed_at":"2023-10-15T13:35:05.000Z","size":139,"stargazers_count":10,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-11T07:09:48.227Z","etag":null,"topics":["bold","chat","code","emphasis","formatter","html","italic","strikethrough","sub","sup"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mattmezza.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-20T10:52:52.000Z","updated_at":"2023-03-29T21:48:50.000Z","dependencies_parsed_at":"2024-06-18T18:20:40.641Z","dependency_job_id":"34fc1e81-d66a-4b18-8f8d-116de11a965e","html_url":"https://github.com/mattmezza/msgdown","commit_stats":{"total_commits":10,"total_committers":3,"mean_commits":"3.3333333333333335","dds":0.5,"last_synced_commit":"74432da9e5343d5a138e11fec89c22eab2c58a1a"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattmezza%2Fmsgdown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattmezza%2Fmsgdown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattmezza%2Fmsgdown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattmezza%2Fmsgdown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mattmezza","download_url":"https://codeload.github.com/mattmezza/msgdown/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221720370,"owners_count":16869474,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bold","chat","code","emphasis","formatter","html","italic","strikethrough","sub","sup"],"created_at":"2024-10-10T07:09:47.027Z","updated_at":"2024-10-27T19:09:03.681Z","avatar_url":"https://github.com/mattmezza.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"msgdown\n======\n\nA simple message formatter for bold, strikethrough, underline, sub, sup, italic and code.\n\n\n![msgdown](https://img.shields.io/travis/mattmezza/msgdown.svg?style=for-the-badge)\n\n![logo](https://github.com/mattmezza/msgdown/blob/master/logo.png)\n\n### Installation\n\n`yarn add msgdown`\n\n### Usage\n\n```js\nconst down = require('msgdown')\n\nconst msg = `*Attention:* /msgdown/^TM^ is great¡1¡. _Use it_ or ~don\\'t~ it is \\`console.log('up to you!')\\``\nconst html = down(msg)\n```\n\n`html` will contain exactly this:\n\n```html\n\u003cstrong\u003eAttention:\u003c/strong\u003e \u003cem\u003emsgdown\u003c/em\u003e\u003csup\u003eTM\u003c/sup\u003e is great\u003csub\u003e1\u003c/sub\u003e. \u003cu\u003eUse it\u003c/u\u003e or \u003cdel\u003edon\\'t\u003c/del\u003e it is \u003ccode\u003econsole.log('up to you!')\u003c/code\u003e\n```\n\n#### Custom tokens\n\nBy default `msgdown` will use these tokens:\n\n```js\nconst defaultTokens = {\n  bold: {delimiter: '*', tag: 'strong'},\n  italic: {delimiter: '/', tag: 'em'},\n  underline: {delimiter: '_', tag: 'u'},\n  strike: {delimiter: '~', tag: 'del'},\n  code: {delimiter: '`', tag: 'code'},\n  sup: {delimiter: '^', tag: 'sup'},\n  sub: {delimiter: '¡', tag: 'sub'}\n}\n```\n\nYou can override every and each of the tokens by passing in your custom token object on every function call:\n\n```js\nconst html = down('ßI am bold with a bß', {bold: {delmiter: 'ß', tag: 'b'}})\n```\n\nThe above `html` will contain `\u003cb\u003eI am bold with a b\u003c/b\u003e`.\n\n### Testing\n\nThere is a test file linked to `yarn test`. Should be enough even though enough is never enough.\n\n### Development\n\nMaybe add more tokens? Maybe add pattern matching instead of plain one char matching? Maybe something else? You name it...\n\n### Author\n\nMatteo Merola \u003cmattmezza@gmail.com\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattmezza%2Fmsgdown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattmezza%2Fmsgdown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattmezza%2Fmsgdown/lists"}