{"id":13911198,"url":"https://github.com/acmenlei/markdown-plus","last_synced_at":"2025-04-13T03:24:27.565Z","repository":{"id":60132510,"uuid":"540862751","full_name":"acmenlei/markdown-plus","owner":"acmenlei","description":"A Markdown parser developed in typescript.","archived":false,"fork":false,"pushed_at":"2024-07-06T02:53:39.000Z","size":6855,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-26T20:21:46.070Z","etag":null,"topics":["highlight","line-number","markdown","markdown-parser","markdown-plugin","markdown-transformer","typescript"],"latest_commit_sha":null,"homepage":"https://acmenlei.github.io/markdown-transform-html-demo/dist/","language":"TypeScript","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/acmenlei.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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":"2022-09-24T14:48:06.000Z","updated_at":"2024-12-04T17:52:42.000Z","dependencies_parsed_at":"2024-07-06T04:07:55.366Z","dependency_job_id":null,"html_url":"https://github.com/acmenlei/markdown-plus","commit_stats":null,"previous_names":["acmenlei/markdown-plus"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acmenlei%2Fmarkdown-plus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acmenlei%2Fmarkdown-plus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acmenlei%2Fmarkdown-plus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acmenlei%2Fmarkdown-plus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/acmenlei","download_url":"https://codeload.github.com/acmenlei/markdown-plus/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248658485,"owners_count":21140953,"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":["highlight","line-number","markdown","markdown-parser","markdown-plugin","markdown-transformer","typescript"],"created_at":"2024-08-07T00:02:01.273Z","updated_at":"2025-04-13T03:24:27.540Z","avatar_url":"https://github.com/acmenlei.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\t\u003ch3\u003emarkdown-transform-html\u003c/h3\u003e\n\t\u003cp align=\"center\"\u003e\n\t    \u003ca href=\"https://github.com/Acmenlei/markdown-to-html/tree/master\" target=\"_blank\"\u003e\n\t        \u003cimg src=\"https://img.shields.io/badge/markdown--transform--html-%3E1.3-ff69b4\" alt=\"markdown-transform-html\"\u003e\n\t    \u003c/a\u003e\n\t\t\u003ca href=\"https://www.tslang.cn/\" target=\"_blank\"\u003e\n\t        \u003cimg src=\"https://img.shields.io/badge/typescript-%3E4.0.0-blue\" alt=\"typescript\"\u003e\n\t    \u003c/a\u003e\n\t\u003c/p\u003e\n\t\u003cp\u003e\u0026nbsp;\u003c/p\u003e\n\u003c/div\u003e\n\n## Introduce\nMarkdown converter, convert Markdwon content to HTML format, and provide code line number display and code highlighting effect (currently support javascript, HTML and other languages, later will support C, C++, Java, JS, TS, Ruby, Rust, PHP, GO, ...).\n\n[The online demo](https://acmenlei.github.io/markdown-transform-html-demo/dist/)\n\n## Prompt\nTo make the style apply only to the part that needs to be parsed, be sure to add a 'markdown-transform-html' class declaration to the parsed container.\n## Use\n### install\n```shell\npnpm install markdown-transform-html\n```\nor\n```shell\nnpm install markdown-transform-html\n```\nor\n```shell\nyarn add markdown-transform-html\n```\n## Example\n```ts\nimport { markdownToHTML } from \"markdown-transform-html\"\nimport  \"markdown-transform-html/lib/styles/index.css\";\n\nconst markdownContent = `#### level 4`;\nconst html = markdownToHTML(markdownContent);\n(document.querySelector(\"#app\") as Element).innerHTML = html;\n```\n## Highlighting\nIf you want to highlight code, then you need to introduce the following css styles and configure options, which is optional.\n\n```ts\nmarkdownToHTML(markdownContent, { highlight: true });\n```\n\n## MarkdownToHTML Options\nConfigure the markdownToHTML options\n| property name        | type    | default value | meaning |\n| -------------------- | ------- | ------------- | ------- |\n| lineNumber      | Boolean  | false | If you need line numbers, turn this option on |\n| highlight      | Boolean  | false          | If you need to highlight code in markdown, turn this option on |\n| xss      | Boolean  | true          | To prevent users from xss attacks on your application, xss is used by default. If you want to turn it off, you can set it to false |\n\n## Problems\nQ: Why does highlighting fail after code changes?\n\nA: After the content has been modified you should re-highlight the code using the `reHighlight` method\n```js\n// example\nimport { reHighlight } from \"markdown-transform-html\"\nreHighlight();\n```\n## Sponsorship\n\nIf you think this project is helpful to you and circumstances permit, you can give me a little support. In short, thank you very much for your support ~\n\n\u003cdiv style=\"display: flex; gap: 20px;\" \u003e\n\u003cdiv style=\"text-align: center\"\u003e\n\u003cp\u003eWeChat\u003c/p\u003e\n\u003cimg style=\"width: 165px; height: 165px\" src=\"./docs/wechat.jpg \"alt=\" wechat\" /\u003e\n\u003c/div\u003e\n\u003cdiv style=\"text-align: center\"\u003e\n\u003cp\u003eAlipay\u003c/p\u003e\n\u003cimg style=\"width: 165px; height: 165px\" src=\"./docs/alipay.jpg \"alt=\" alipay\" /\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\n## License\n\nMIT © [coderlei](./license)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facmenlei%2Fmarkdown-plus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Facmenlei%2Fmarkdown-plus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facmenlei%2Fmarkdown-plus/lists"}