{"id":15395817,"url":"https://github.com/mvasilkov/cmark-gfm","last_synced_at":"2025-10-27T21:30:20.377Z","repository":{"id":42833960,"uuid":"232332703","full_name":"mvasilkov/cmark-gfm","owner":"mvasilkov","description":"GitHub Flavored Markdown ¦ Native bindings for cmark-gfm, GitHub's fork of cmark, a CommonMark parsing and rendering library","archived":false,"fork":false,"pushed_at":"2022-12-11T05:56:06.000Z","size":424,"stargazers_count":2,"open_issues_count":5,"forks_count":2,"subscribers_count":4,"default_branch":"@mvasilkov/cmark-gfm","last_synced_at":"2025-01-02T20:49:10.303Z","etag":null,"topics":["cmark","commonmark","gfm","github-flavored-markdown","markdown","nodejs","nodejs-native-addon"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@mvasilkov/cmark-gfm","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/mvasilkov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-07T13:40:40.000Z","updated_at":"2023-11-18T16:39:08.000Z","dependencies_parsed_at":"2023-01-26T16:46:04.345Z","dependency_job_id":null,"html_url":"https://github.com/mvasilkov/cmark-gfm","commit_stats":null,"previous_names":["mvasilkov/node-cmark-gfm"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvasilkov%2Fcmark-gfm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvasilkov%2Fcmark-gfm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvasilkov%2Fcmark-gfm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvasilkov%2Fcmark-gfm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mvasilkov","download_url":"https://codeload.github.com/mvasilkov/cmark-gfm/tar.gz/refs/heads/@mvasilkov/cmark-gfm","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236904435,"owners_count":19223153,"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":["cmark","commonmark","gfm","github-flavored-markdown","markdown","nodejs","nodejs-native-addon"],"created_at":"2024-10-01T15:29:39.708Z","updated_at":"2025-10-27T21:30:15.034Z","avatar_url":"https://github.com/mvasilkov.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"cmark-gfm\n===\n\nGitHub Flavored Markdown ¦ Native bindings for cmark-gfm, GitHub's fork of cmark, a CommonMark parsing and rendering library\n\n[![npm][npm-badge]][npm-url]\n[![dependencies][dependencies-badge]][dependencies-url]\n[![travis][travis-badge]][travis-url]\n[![appveyor][appveyor-badge]][appveyor-url]\n\n---\n\nInstallation\n---\n\n```sh\nnpm add @mvasilkov/cmark-gfm\n```\n\nUsage\n---\n\n```javascript\nconst { renderHtmlSync } = require('@mvasilkov/cmark-gfm')\n\nconst html = renderHtmlSync('# hello, world')\n// returns \u003ch1\u003ehello, world\u003c/h1\u003e\n```\n\n### Asynchronous usage\n\n```javascript\nconst { renderHtml } = require('@mvasilkov/cmark-gfm')\n\n// With async/await\nconst html = await renderHtml('# hello, world')\n\n// With Promises\nrenderHtml('# hello, world').then(html =\u003e {})\n\n// With node-style callbacks\nrenderHtml('# hello, world', (err, html) =\u003e {})\n```\n\n### Passing options\n\n```javascript\nrenderHtmlSync('# hello, world', { sourcepos: true })\n// returns \u003ch1 data-sourcepos=\"1:1-1:14\"\u003ehello, world\u003c/h1\u003e\n\nawait renderHtml('# hello, world', { sourcepos: true })\n// equivalent to the above\n```\n\nAll available options are listed below.\n\n### Using extensions\n\n```javascript\nrenderHtmlSync('# hello, https://sr.ht/', {\n  extensions: { autolink: true }\n})\n// returns \u003ch1\u003ehello, \u003ca href=\"https://sr.ht/\"\u003ehttps://sr.ht/\u003c/a\u003e\u003c/h1\u003e\n\nawait renderHtml('# hello, https://sr.ht/', {\n  extensions: { autolink: true }\n})\n// equivalent to the above\n```\n\nSupported extensions are listed below.\n\n### Usage with streams\n\n```javascript\nconst fs = require('fs')\nconst { StreamingParser } = require('@mvasilkov/cmark-gfm')\n\nfs.createReadStream('README.md')\n  .pipe(new StreamingParser({ extensions: { table: true } }))\n  .pipe(fs.createWriteStream('README.html'))\n```\n\nOptions\n---\n\nAll of the following options are boolean, and off by default.\n\n### Options affecting rendering\n\n| Option | Što\n| --- | ---\n| sourcepos | Include a `data-sourcepos` attribute on all block elements.\n| hardbreaks | Render `softbreak` elements as hard line breaks.\n| unsafe | Render raw HTML and unsafe links.\n| nobreaks | Render `softbreak` elements as spaces.\n| react | Produce React-compatible output (JSX).\n\n### Options affecting parsing\n\n| Option | Što\n| --- | ---\n| validateUtf8 | Validate UTF-8 in the input before parsing, replacing illegal sequences with the replacement character U+FFFD.\n| smart | Convert straight quotes to curly, `---` to em dashes, `--` to en dashes.\n| githubPreLang | Use GitHub-style `\u003cpre lang=\"x\"\u003e` tags for code blocks instead of `\u003cpre\u003e\u003ccode class=\"language-x\"\u003e`.\n| liberalHtmlTag | Be liberal in interpreting inline HTML tags.\n| footnotes | Parse footnotes.\n| strikethroughDoubleTilde | Only parse strikethroughs if surrounded by exactly 2 tildes. Gives some compatibility with redcarpet.\n| tablePreferStyleAttributes | Use `style` attributes to align table cells instead of `align` attributes.\n| fullInfoString | Include the remainder of the info string in code blocks in a separate attribute.\n\n### Extensions\n\n| Extension | Što\n| --- | ---\n| autolink | Output web addresses and emails as hyperlinks.\n| strikethrough | Enable the `~~strikethrough~~` syntax.\n| table | Enable [tables][tables].\n| tagfilter | Escape the following HTML tags: `title`, `textarea`, `style`, `xmp`, `iframe`, `noembed`, `noframes`, `script`, and `plaintext`.\n| tasklist | Enable [task lists][task-lists].\n\nAuthors\n---\n\nThis is a fork of [Michelle Tilley][BinaryMuse]'s repo. It's entirely compatible with the upstream, and brings the following improvements:\n\n* Convert to TypeScript\n* Update the underlying C library to the latest master\n* Exclude dead code from compilation\n* Reduce dev dependencies' footprint\n* Optional React (JSX) support\n\nMaintained by [Mark Vasilkov][mvasilkov].\n\nLicense\n---\n\nMIT\n\n[npm-badge]: https://img.shields.io/npm/v/@mvasilkov/cmark-gfm.svg?style=flat\n[npm-url]: https://www.npmjs.com/package/@mvasilkov/cmark-gfm\n[dependencies-badge]: https://img.shields.io/librariesio/release/npm/@mvasilkov/cmark-gfm?style=flat\n[dependencies-url]: https://www.npmjs.com/package/@mvasilkov/cmark-gfm?activeTab=dependencies\n[travis-badge]: https://img.shields.io/travis/mvasilkov/cmark-gfm/@mvasilkov/cmark-gfm?style=flat\n[travis-url]: https://travis-ci.org/github/mvasilkov/cmark-gfm\n[appveyor-badge]: https://ci.appveyor.com/api/projects/status/2w02o0n3vpid13ho/branch/@mvasilkov/cmark-gfm?svg=true\n[appveyor-url]: https://ci.appveyor.com/project/mvasilkov/cmark-gfm\n\n[tables]: https://help.github.com/en/github/writing-on-github/organizing-information-with-tables\n[task-lists]: https://github.blog/2014-04-28-task-lists-in-all-markdown-documents/\n\n[BinaryMuse]: https://github.com/BinaryMuse\n[mvasilkov]: https://github.com/mvasilkov\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmvasilkov%2Fcmark-gfm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmvasilkov%2Fcmark-gfm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmvasilkov%2Fcmark-gfm/lists"}