{"id":17537703,"url":"https://github.com/bates64/mrk","last_synced_at":"2026-01-15T22:20:40.386Z","repository":{"id":57303860,"uuid":"114652923","full_name":"bates64/mrk","owner":"bates64","description":"🗒️ Tiny extensible markdown parser/renderer single-file JS library","archived":false,"fork":false,"pushed_at":"2022-12-21T23:03:29.000Z","size":30,"stargazers_count":17,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2026-01-13T03:35:50.648Z","etag":null,"topics":["javascript","js","markdown","markdown-parser"],"latest_commit_sha":null,"homepage":"https://mrk.nanaian.town","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/bates64.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-18T14:51:35.000Z","updated_at":"2024-10-06T08:15:23.000Z","dependencies_parsed_at":"2023-01-30T05:01:01.307Z","dependency_job_id":null,"html_url":"https://github.com/bates64/mrk","commit_stats":null,"previous_names":["heyitsmeuralex/mrk","bates64/mrk","nanaian/mrk"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bates64/mrk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bates64%2Fmrk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bates64%2Fmrk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bates64%2Fmrk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bates64%2Fmrk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bates64","download_url":"https://codeload.github.com/bates64/mrk/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bates64%2Fmrk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28472626,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-15T22:13:38.078Z","status":"ssl_error","status_checked_at":"2026-01-15T22:12:11.737Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["javascript","js","markdown","markdown-parser"],"created_at":"2024-10-20T20:42:35.404Z","updated_at":"2026-01-15T22:20:40.363Z","avatar_url":"https://github.com/bates64.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align='center'\u003e 🗒️ mrk \u003c/h1\u003e\n\n\u003cdiv align='center'\u003e\n  \u003cstrong\u003e Tiny extensible markdown renderer \u003c/strong\u003e\n\u003c/div\u003e\n\n\u003cdiv align='center'\u003e\n  \u003ch3\u003e\n    \u003ca href='#how-do-i-use-it'\u003eUsage\u003c/a\u003e\n    |\n    \u003ca href='https://mrk.nanaian.town'\u003eTry in your browser\u003c/a\u003e\n    |\n    \u003ca href='https://github.com/nanaian/mrk/wiki'\u003eExtensions\u003c/a\u003e\n  \u003c/h3\u003e\n\u003c/div\u003e\n\nmrk is a tiny, easily-extensible markdown parser created for [Decent](https://github.com/decent-chat/decent). We needed it\nfor a few reasons:\n\n* We didn't want to have to bring in an **npm** module or do anything fancy to use it\n* We needed to be able to **disable features** and add new ones easily\n* We wanted access to the parsed **token stream**\n* We wanted something small, simple, and **easy to extend**\n\n### How do I use it?\n\nInclude [mrk.js](mrk.js) in your page, or `npm install mrkjs`:\nUsage is as follows:\n\n```js\n// require('mrk.js') or \u003cscript src='mrk.js'\u003e\u003c/script\u003e\n\nlet mark = mrk()\nlet html = mark('Some _markdown_').html()\nconsole.log(html)\n```\n\nThat's it! You can also directly access the parsed token stream by looking at `mark(...).tokens`, if you're so inclined.\n\n### Can I haz `Promise`?\n\nYes!!\n\n```js\nconst mrk = require('mrk.js/async')\nconst mark = mrk()\n\nmark('Awesome!').then(parsed =\u003e {\n  console.log('tokens:', parsed.tokens)\n\n  return parsed.html()\n}).then(html =\u003e {\n  console.log('HTML:', html)\n})\n```\n\n### I want/to remove Feature X!\n\nYou can implement/remove it yourself. mrk was designed to be easily extendable:\n\n#### Removing a feature\n\n```js\nmark('Visit http://google.com').html() // Visit \u003ca href='http://google.com'\u003ehttp://google.com\u003c/a\u003e\n\ndelete mark.patterns.autolink // See mrk.js for other patterns/features you can remove\n\nmark('Visit http://google.com').html() // Visit http://google.com\n```\n\n#### Adding a new parse rule\n\nSay we wanted to add `~~strikethrough~~` text, GFM-style:\n\n```js\n// Pass `mrk()` extensions to patterns, pairs, or htmlify\nconst markWithStrikethrough = mrk({\n  extendPatterns: {\n    strikethroughStart: ({ read, has }) =\u003e {\n      // If this function returns a truthy value, it will be parsed as a strikethroughStart token\n      // See mrk.js for how `read` and `has` work, plus other functions you get access to.\n\n      return read(2) === '~~' // Next 2 characters should be `~~`\n        \u0026\u0026 !has('strikethroughStart', 'strikethroughEnd') // Not already strikethrough!\n    },\n\n    strikethroughEnd: ({ read, has }) =\u003e {\n      return read(2) === '~~' // Next 2 characters should be `~~`\n        \u0026\u0026 has('strikethroughStart', 'strikethroughEnd') // Must have a strikethroughStart before this token\n    },\n  },\n\n  extendPairs: {\n    // If there is a strikethroughStart token on its own without a strikethroughEnd token to be paired\n    // to, it will be discarded and parsed as text.\n    strikethroughStart: 'strikethroughEnd'\n  },\n\n  extendHtmlify: {\n    // Declares how to convert these tokens into HTML strings.\n    strikethroughStart = () =\u003e '\u003cs\u003e',\n    strikethroughEnd = () =\u003e '\u003c/s\u003e'\n  }\n})\n\n// :tada:\nmrk('~~hello~~').html() // =\u003e \u003cs\u003ehello\u003c/s\u003e\n```\n\nIf you end up creating an extension for mrk for your project and it's generic enough,\n[please consider adding it to the list](https://github.com/nanaian/mrk/wiki) of\ncommunity extensions for mrk. I'd appreciate it!\n\n### License\n\nMIT :tada:\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbates64%2Fmrk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbates64%2Fmrk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbates64%2Fmrk/lists"}