
Security News
US Government Forces Anthropic to Pull Claude Fable Days After Launch
Anthropic says the directive cited national security concerns over a narrow jailbreak, but offered no specific technical details.
mdast-util-sub-sup
Advanced tools
mdast utility to parse and serialize subscript (_{...}) and superscript (^{...})
mdast utilities for subscript and superscript nodes.
npm install mdast-util-sub-sup
import { fromMarkdown } from 'mdast-util-from-markdown'
import { toMarkdown } from 'mdast-util-to-markdown'
import { subSup } from 'micromark-extension-sub-sup'
import { subSupFromMarkdown, subSupToMarkdown } from 'mdast-util-sub-sup'
const tree = fromMarkdown('H_{2}O', {
extensions: [subSup()],
mdastExtensions: [subSupFromMarkdown()]
})
const markdown = toMarkdown(tree, {
extensions: [subSupToMarkdown()]
})
interface Subscript extends Node {
type: 'subscript'
children: PhrasingContent[]
}
Renders to <sub> in HTML.
interface Superscript extends Node {
type: 'superscript'
children: PhrasingContent[]
}
Renders to <sup> in HTML.
subSupFromMarkdown()Extension for mdast-util-from-markdown to parse subscript/superscript.
subSupToMarkdown()Extension for mdast-util-to-markdown to serialize subscript/superscript.
When serializing to markdown, balanced braces are preserved:
_{a{b}c} → _{a{b}c} (balanced, no escaping needed)Unbalanced braces are escaped:
} is escaped as \}{ is escaped as \{\ before {, }, or \ is passed through as-ismicromark-extension-sub-sup — tokenizerremark-sub-sup — remark pluginMIT
FAQs
mdast utility to parse and serialize subscript (_{...}) and superscript (^{...})
We found that mdast-util-sub-sup 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.

Security News
Anthropic says the directive cited national security concerns over a narrow jailbreak, but offered no specific technical details.

Security News
A network of 152 Chrome live wallpaper extensions hid ad tracking and made extension-driven traffic look like Google search clicks.

Company News
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.