
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
markdown-transform-html
Advanced tools
markdown-plus is a Markdown to HTML plug-in written in TypeScript that not only supports common conversions of Markdown syntax, but also extends multi-column layouts and icon syntax.(markdown-plus是一款基于TypeScript编写的Markdown转HTML插件,它不仅支持Markdown语法的常见转换,还扩展了
Markdown 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, ...).
To 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.
pnpm install markdown-transform-html
or
npm install markdown-transform-html
or
yarn add markdown-transform-html
import { markdownToHTML } from "markdown-transform-html"
import "markdown-transform-html/lib/styles/index.css";
const markdownContent = `#### level 4`;
const html = markdownToHTML(markdownContent);
(document.querySelector("#app") as Element).innerHTML = html;
If you want to highlight code, then you need to introduce the following css styles and configure options, which is optional.
markdownToHTML(markdownContent, { highlight: true });
Configure the markdownToHTML options
| property name | type | default value | meaning |
|---|---|---|---|
| lineNumber | Boolean | false | If you need line numbers, turn this option on |
| highlight | Boolean | false | If you need to highlight code in markdown, turn this option on |
| 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 |
Q: Why does highlighting fail after code changes?
A: After the content has been modified you should re-highlight the code using the reHighlight method
// example
import { reHighlight } from "markdown-transform-html"
reHighlight();
If 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 ~
Alipay
MIT © coderlei
FAQs
markdown-plus is a Markdown to HTML plug-in written in TypeScript that not only supports common conversions of Markdown syntax, but also extends multi-column layouts and icon syntax.(markdown-plus是一款基于TypeScript编写的Markdown转HTML插件,它不仅支持Markdown语法的常见转换,还扩展了
The npm package markdown-transform-html receives a total of 105 weekly downloads. As such, markdown-transform-html popularity was classified as not popular.
We found that markdown-transform-html demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.