{"id":19501122,"url":"https://github.com/gitbookio/markup-it","last_synced_at":"2025-10-05T15:02:48.957Z","repository":{"id":46915543,"uuid":"53600735","full_name":"GitbookIO/markup-it","owner":"GitbookIO","description":"JavaScript library to parse and serialize markup content (Markdown and HTML)","archived":false,"fork":false,"pushed_at":"2023-07-18T20:15:42.000Z","size":1780,"stargazers_count":273,"open_issues_count":36,"forks_count":50,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-05-15T23:03:58.360Z","etag":null,"topics":["javascript","markdown","slate","wysiwyg"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GitbookIO.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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":"2016-03-10T16:40:47.000Z","updated_at":"2025-05-11T06:37:33.000Z","dependencies_parsed_at":"2024-06-18T13:47:17.959Z","dependency_job_id":"5fab77a9-0f47-481f-9588-e0b66e9004b6","html_url":"https://github.com/GitbookIO/markup-it","commit_stats":{"total_commits":690,"total_committers":10,"mean_commits":69.0,"dds":0.3536231884057971,"last_synced_commit":"4c0538ebc0a5767276fe8352493c8d386f971fd3"},"previous_names":["gitbookio/draft-markup"],"tags_count":93,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GitbookIO%2Fmarkup-it","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GitbookIO%2Fmarkup-it/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GitbookIO%2Fmarkup-it/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GitbookIO%2Fmarkup-it/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GitbookIO","download_url":"https://codeload.github.com/GitbookIO/markup-it/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254436944,"owners_count":22070946,"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":["javascript","markdown","slate","wysiwyg"],"created_at":"2024-11-10T22:11:14.854Z","updated_at":"2025-10-05T15:02:48.902Z","avatar_url":"https://github.com/GitbookIO.png","language":"JavaScript","readme":"# markup-it\n\n[![Build Status](https://travis-ci.org/GitbookIO/markup-it.svg?branch=master)](https://travis-ci.org/GitbookIO/markup-it)\n[![NPM version](https://badge.fury.io/js/markup-it.svg)](http://badge.fury.io/js/markup-it)\n\n`markup-it` is a JavaScript library to serialize/deserialize markdown content using an intermediate format backed by an immutable model.\n\n\n### Installation\n\n```\n$ npm i markup-it --save\n```\n\nor\n\n```\n$ yarn add markup-it\n```\n\n### Usage\n\n#### Parse markdown\n\n```js\nconst { State, MarkdownParser } = require('markup-it');\n\nconst state = State.create(MarkdownParser);\nconst document = state.deserializeToDocument('Hello **World**');\n```\n\n#### Render document to HTML\n\n```js\nconst { State, HTMLParser } = require('markup-it');\n\nconst state = State.create(HTMLParser);\nconst str = state.serializeDocument(document);\n```\n\n#### Render document to Markdown\n\n```js\nconst { State, MarkdownParser } = require('markup-it');\n\nconst state = State.create(markdown);\nconst str = state.serializeDocument(document);\n```\n\n### ES6\n\n`markup-it` is [ESM](https://hacks.mozilla.org/2018/03/es-modules-a-cartoon-deep-dive/) compliant through the package.json `module` field, so you can safely use it with ES6 syntax for tree-shaking.\n\n```js\nimport { State, HTMLParser } from 'markup-it';\n\nconst state = State.create(HTMLParser);\nconst str = state.serializeDocument(document);\n```\n\n### Testing\n\nThere are many scripts available in the `/bin` folder to output an HTML or Markdown file to multiple formats (HTML, Hyperscript, JSON, Markdown, YAML).\n\nThese scripts can be called with `babel-node`, for example:\n\n```\nbabel-node bin/toJSON.js ./page.md\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgitbookio%2Fmarkup-it","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgitbookio%2Fmarkup-it","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgitbookio%2Fmarkup-it/lists"}