{"id":13396577,"url":"https://github.com/markdown-it/markdown-it","last_synced_at":"2025-05-12T20:45:51.297Z","repository":{"id":24834828,"uuid":"28249537","full_name":"markdown-it/markdown-it","owner":"markdown-it","description":"Markdown parser, done right. 100% CommonMark support, extensions, syntax plugins \u0026 high speed","archived":false,"fork":false,"pushed_at":"2024-08-04T11:25:40.000Z","size":3828,"stargazers_count":19516,"open_issues_count":54,"forks_count":1746,"subscribers_count":179,"default_branch":"master","last_synced_at":"2025-05-05T16:05:58.034Z","etag":null,"topics":["commonmark","javascript","markdown"],"latest_commit_sha":null,"homepage":"https://markdown-it.github.io","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/markdown-it.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"docs/security.md","support":"support/api_header.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"markdown-it","open_collective":"markdown-it","tidelift":"npm/markdown-it"}},"created_at":"2014-12-19T22:54:53.000Z","updated_at":"2025-05-05T14:29:44.000Z","dependencies_parsed_at":"2023-09-26T18:33:11.140Z","dependency_job_id":"fa13985c-b0f8-4d85-a53c-06675efb7892","html_url":"https://github.com/markdown-it/markdown-it","commit_stats":{"total_commits":1063,"total_committers":87,"mean_commits":"12.218390804597702","dds":0.3668861712135466,"last_synced_commit":"0fe7ccb4b7f30236fb05f623be6924961d296d3d"},"previous_names":[],"tags_count":79,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markdown-it%2Fmarkdown-it","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markdown-it%2Fmarkdown-it/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markdown-it%2Fmarkdown-it/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markdown-it%2Fmarkdown-it/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markdown-it","download_url":"https://codeload.github.com/markdown-it/markdown-it/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252638571,"owners_count":21780615,"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":["commonmark","javascript","markdown"],"created_at":"2024-07-30T18:00:57.238Z","updated_at":"2025-05-12T20:45:50.717Z","avatar_url":"https://github.com/markdown-it.png","language":"JavaScript","readme":"# markdown-it \u003c!-- omit in toc --\u003e\n\n[![CI](https://github.com/markdown-it/markdown-it/actions/workflows/ci.yml/badge.svg)](https://github.com/markdown-it/markdown-it/actions/workflows/ci.yml)\n[![NPM version](https://img.shields.io/npm/v/markdown-it.svg?style=flat)](https://www.npmjs.org/package/markdown-it)\n[![Coverage Status](https://coveralls.io/repos/markdown-it/markdown-it/badge.svg?branch=master\u0026service=github)](https://coveralls.io/github/markdown-it/markdown-it?branch=master)\n[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/markdown-it/markdown-it)\n\n\u003e Markdown parser done right. Fast and easy to extend.\n\n__[Live demo](https://markdown-it.github.io)__\n\n- Follows the __[CommonMark spec](http://spec.commonmark.org/)__ + adds syntax extensions \u0026 sugar (URL autolinking, typographer).\n- Configurable syntax! You can add new rules and even replace existing ones.\n- High speed.\n- [Safe](https://github.com/markdown-it/markdown-it/tree/master/docs/security.md) by default.\n- Community-written __[plugins](https://www.npmjs.org/browse/keyword/markdown-it-plugin)__ and [other packages](https://www.npmjs.org/browse/keyword/markdown-it) on npm.\n\n__Table of content__\n\n- [Install](#install)\n- [Usage examples](#usage-examples)\n  - [Simple](#simple)\n  - [Init with presets and options](#init-with-presets-and-options)\n  - [Plugins load](#plugins-load)\n  - [Syntax highlighting](#syntax-highlighting)\n  - [Linkify](#linkify)\n- [API](#api)\n- [Syntax extensions](#syntax-extensions)\n  - [Manage rules](#manage-rules)\n- [Benchmark](#benchmark)\n- [markdown-it for enterprise](#markdown-it-for-enterprise)\n- [Authors](#authors)\n- [References / Thanks](#references--thanks)\n\n## Install\n\n**node.js**:\n\n```bash\nnpm install markdown-it\n```\n\n**browser (CDN):**\n\n- [jsDeliver CDN](http://www.jsdelivr.com/#!markdown-it \"jsDelivr CDN\")\n- [cdnjs.com CDN](https://cdnjs.com/libraries/markdown-it \"cdnjs.com\")\n\n\n## Usage examples\n\nSee also:\n\n- __[API documentation](https://markdown-it.github.io/markdown-it/)__ - for more\n  info and examples.\n- [Development info](https://github.com/markdown-it/markdown-it/tree/master/docs) -\n  for plugins writers.\n\n\n### Simple\n\n```js\n// node.js\n// can use `require('markdown-it')` for CJS\nimport markdownit from 'markdown-it'\nconst md = markdownit()\nconst result = md.render('# markdown-it rulezz!');\n\n// browser with UMD build, added to \"window\" on script load\n// Note, there is no dash in \"markdownit\".\nconst md = window.markdownit();\nconst result = md.render('# markdown-it rulezz!');\n```\n\nSingle line rendering, without paragraph wrap:\n\n```js\nimport markdownit from 'markdown-it'\nconst md = markdownit()\nconst result = md.renderInline('__markdown-it__ rulezz!');\n```\n\n\n### Init with presets and options\n\n(*) presets define combinations of active rules and options. Can be\n`\"commonmark\"`, `\"zero\"` or `\"default\"` (if skipped). See\n[API docs](https://markdown-it.github.io/markdown-it/#MarkdownIt.new) for more details.\n\n```js\nimport markdownit from 'markdown-it'\n\n// commonmark mode\nconst md = markdownit('commonmark')\n\n// default mode\nconst md = markdownit()\n\n// enable everything\nconst md = markdownit({\n  html: true,\n  linkify: true,\n  typographer: true\n})\n\n// full options list (defaults)\nconst md = markdownit({\n  // Enable HTML tags in source\n  html:         false,\n\n  // Use '/' to close single tags (\u003cbr /\u003e).\n  // This is only for full CommonMark compatibility.\n  xhtmlOut:     false,\n\n  // Convert '\\n' in paragraphs into \u003cbr\u003e\n  breaks:       false,\n\n  // CSS language prefix for fenced blocks. Can be\n  // useful for external highlighters.\n  langPrefix:   'language-',\n\n  // Autoconvert URL-like text to links\n  linkify:      false,\n\n  // Enable some language-neutral replacement + quotes beautification\n  // For the full list of replacements, see https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/replacements.mjs\n  typographer:  false,\n\n  // Double + single quotes replacement pairs, when typographer enabled,\n  // and smartquotes on. Could be either a String or an Array.\n  //\n  // For example, you can use '«»„“' for Russian, '„“‚‘' for German,\n  // and ['«\\xA0', '\\xA0»', '‹\\xA0', '\\xA0›'] for French (including nbsp).\n  quotes: '“”‘’',\n\n  // Highlighter function. Should return escaped HTML,\n  // or '' if the source string is not changed and should be escaped externally.\n  // If result starts with \u003cpre... internal wrapper is skipped.\n  highlight: function (/*str, lang*/) { return ''; }\n});\n```\n\n### Plugins load\n\n```js\nimport markdownit from 'markdown-it'\n\nconst md = markdownit\n  .use(plugin1)\n  .use(plugin2, opts, ...)\n  .use(plugin3);\n```\n\n\n### Syntax highlighting\n\nApply syntax highlighting to fenced code blocks with the `highlight` option:\n\n```js\nimport markdownit from 'markdown-it'\nimport hljs from 'highlight.js' // https://highlightjs.org\n\n// Actual default values\nconst md = markdownit({\n  highlight: function (str, lang) {\n    if (lang \u0026\u0026 hljs.getLanguage(lang)) {\n      try {\n        return hljs.highlight(str, { language: lang }).value;\n      } catch (__) {}\n    }\n\n    return ''; // use external default escaping\n  }\n});\n```\n\nOr with full wrapper override (if you need assign class to `\u003cpre\u003e` or `\u003ccode\u003e`):\n\n```js\nimport markdownit from 'markdown-it'\nimport hljs from 'highlight.js' // https://highlightjs.org\n\n// Actual default values\nconst md = markdownit({\n  highlight: function (str, lang) {\n    if (lang \u0026\u0026 hljs.getLanguage(lang)) {\n      try {\n        return '\u003cpre\u003e\u003ccode class=\"hljs\"\u003e' +\n               hljs.highlight(str, { language: lang, ignoreIllegals: true }).value +\n               '\u003c/code\u003e\u003c/pre\u003e';\n      } catch (__) {}\n    }\n\n    return '\u003cpre\u003e\u003ccode class=\"hljs\"\u003e' + md.utils.escapeHtml(str) + '\u003c/code\u003e\u003c/pre\u003e';\n  }\n});\n```\n\n### Linkify\n\n`linkify: true` uses [linkify-it](https://github.com/markdown-it/linkify-it). To\nconfigure linkify-it, access the linkify instance through `md.linkify`:\n\n```js\nmd.linkify.set({ fuzzyEmail: false });  // disables converting email to link\n```\n\n\n## API\n\n__[API documentation](https://markdown-it.github.io/markdown-it/)__\n\nIf you are going to write plugins, please take a look at\n[Development info](https://github.com/markdown-it/markdown-it/tree/master/docs).\n\n\n## Syntax extensions\n\nEmbedded (enabled by default):\n\n- [Tables](https://help.github.com/articles/organizing-information-with-tables/) (GFM)\n- [Strikethrough](https://help.github.com/articles/basic-writing-and-formatting-syntax/#styling-text) (GFM)\n\nVia plugins:\n\n- [subscript](https://github.com/markdown-it/markdown-it-sub)\n- [superscript](https://github.com/markdown-it/markdown-it-sup)\n- [footnote](https://github.com/markdown-it/markdown-it-footnote)\n- [definition list](https://github.com/markdown-it/markdown-it-deflist)\n- [abbreviation](https://github.com/markdown-it/markdown-it-abbr)\n- [emoji](https://github.com/markdown-it/markdown-it-emoji)\n- [custom container](https://github.com/markdown-it/markdown-it-container)\n- [insert](https://github.com/markdown-it/markdown-it-ins)\n- [mark](https://github.com/markdown-it/markdown-it-mark)\n- ... and [others](https://www.npmjs.org/browse/keyword/markdown-it-plugin)\n\n\n### Manage rules\n\nBy default all rules are enabled, but can be restricted by options. On plugin\nload all its rules are enabled automatically.\n\n```js\nimport markdownit from 'markdown-it'\n\n// Activate/deactivate rules, with currying\nconst md = markdownit()\n  .disable(['link', 'image'])\n  .enable(['link'])\n  .enable('image');\n\n// Enable everything\nconst md = markdownit({\n  html: true,\n  linkify: true,\n  typographer: true,\n});\n```\n\nYou can find all rules in sources:\n\n- [`parser_core.mjs`](lib/parser_core.mjs)\n- [`parser_block.mjs`](lib/parser_block.mjs)\n- [`parser_inline.mjs`](lib/parser_inline.mjs)\n\n\n## Benchmark\n\nHere is the result of readme parse at MB Pro Retina 2013 (2.4 GHz):\n\n```bash\nnpm run benchmark-deps\nbenchmark/benchmark.mjs readme\n\nSelected samples: (1 of 28)\n \u003e README\n\nSample: README.md (7774 bytes)\n \u003e commonmark-reference x 1,222 ops/sec ±0.96% (97 runs sampled)\n \u003e current x 743 ops/sec ±0.84% (97 runs sampled)\n \u003e current-commonmark x 1,568 ops/sec ±0.84% (98 runs sampled)\n \u003e marked x 1,587 ops/sec ±4.31% (93 runs sampled)\n```\n\n__Note.__ CommonMark version runs with [simplified link normalizers](https://github.com/markdown-it/markdown-it/blob/master/benchmark/implementations/current-commonmark/index.mjs)\nfor more \"honest\" compare. Difference is ≈1.5×.\n\nAs you can see, `markdown-it` doesn't pay with speed for its flexibility.\nSlowdown of \"full\" version caused by additional features not available in\nother implementations.\n\n\n## markdown-it for enterprise\n\nAvailable as part of the Tidelift Subscription.\n\nThe maintainers of `markdown-it` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-markdown-it?utm_source=npm-markdown-it\u0026utm_medium=referral\u0026utm_campaign=enterprise\u0026utm_term=repo)\n\n\n## Authors\n\n- Alex Kocharin [github/rlidwka](https://github.com/rlidwka)\n- Vitaly Puzrin [github/puzrin](https://github.com/puzrin)\n\n_markdown-it_ is the result of the decision of the authors who contributed to\n99% of the _Remarkable_ code to move to a project with the same authorship but\nnew leadership (Vitaly and Alex). It's not a fork.\n\n## References / Thanks\n\nBig thanks to [John MacFarlane](https://github.com/jgm) for his work on the\nCommonMark spec and reference implementations. His work saved us a lot of time\nduring this project's development.\n\n**Related Links:**\n\n- https://github.com/jgm/CommonMark - reference CommonMark implementations in C \u0026 JS,\n  also contains latest spec \u0026 online demo.\n- http://talk.commonmark.org - CommonMark forum, good place to collaborate\n  developers' efforts.\n\n**Ports**\n\n- [motion-markdown-it](https://github.com/digitalmoksha/motion-markdown-it) - Ruby/RubyMotion\n- [markdown-it-py](https://github.com/ExecutableBookProject/markdown-it-py)- Python\n","funding_links":["https://github.com/sponsors/markdown-it","https://opencollective.com/markdown-it","https://tidelift.com/funding/github/npm/markdown-it","https://tidelift.com/subscription/pkg/npm-markdown-it?utm_source=npm-markdown-it\u0026utm_medium=referral\u0026utm_campaign=enterprise\u0026utm_term=repo"],"categories":["JavaScript","markdown","Packages","HarmonyOS","Markdown parser","Repository","Uncategorized","Markdown","包","\u003e 10k ★","Libraries","前端开发框架及项目","markdown-it-ins","Parsing","Web 前端","Markdown Tools","目录","🙌 Marp をもっと楽しむ 🙌","Markdown Libraries","编码与开发工具","🌏开源项目","Number","UI Components / UI Tools"],"sub_categories":["Parsing","Windows Manager","Uncategorized","解析","redux 扩展","macros","JavaScript","其他_文本生成、文本对话","解析工具","Markdown 拡張構文の利用","Javascript Markdown Libraries","开发组件"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkdown-it%2Fmarkdown-it","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkdown-it%2Fmarkdown-it","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkdown-it%2Fmarkdown-it/lists"}