
Company News
Socket Partners with Replit to Block Malicious Packages in AI-Powered Development
Replit is integrating Socket Firewall into its AI-powered development experience to help protect builders from malicious open source packages.
mdast-util-math-inline
Advanced tools
mdast utilities for inline math (:math[...]).
npm install mdast-util-math-inline
import { fromMarkdown } from 'mdast-util-from-markdown'
import { toMarkdown } from 'mdast-util-to-markdown'
import { mathInline } from 'micromark-extension-math-inline'
import { mathInlineFromMarkdown, mathInlineToMarkdown } from 'mdast-util-math-inline'
// Parse
const tree = fromMarkdown(':math[x^2]', {
extensions: [mathInline()],
mdastExtensions: [mathInlineFromMarkdown()]
})
// Stringify
const md = toMarkdown(tree, {
extensions: [mathInlineToMarkdown()]
})
InlineMathinterface InlineMath extends Literal {
type: 'inlineMath'
value: string
data?: {
hName: 'code'
hProperties: { className: ['language-math', 'math-inline'] }
hChildren: [{ type: 'text', value: string }]
}
}
The data fields enable compatibility with remark-rehype and rehype-katex.
When serializing to markdown:
] is escaped as \]\ before ] or \ is escaped as \\MIT
FAQs
mdast utility to parse and serialize inline math (:math[...])
We found that mdast-util-math-inline 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
Replit is integrating Socket Firewall into its AI-powered development experience to help protect builders from malicious open source packages.

Security News
npm confirmed a tooling bug incorrectly marked several one-character packages as security holders and said it was working on a rollback.

Research
/Security News
Newer packages in this compromise use native extensions and .pth loaders to execute JavaScript stealers in developer environments.