Security News
Combatting Alert Fatigue by Prioritizing Malicious Intent
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
remark-sub-super
Advanced tools
This plugin parses custom Markdown syntax to handle subscript and superscript. It adds new nodes types to the [mdast][mdast] produced by [remark][remark]:
This plugin parses custom Markdown syntax to handle subscript and superscript. It adds new nodes types to the mdast produced by remark:
sub
sup
If you are using rehype, the stringified HTML result will be sub
or sup
.
~subscript~, e.g. a~i~
^superscript^, e.g. e^x^
Sub
(Parent
) represents a subscript text.
interface Sub <: Parent {
type: "sub";
}
Sup
(Parent
) represents a superscript text.
interface Sup <: Parent {
type: "sup";
}
For example, the following markdown:
a^x^
x~i~
Yields:
{
type: 'paragraph',
children: [{
type: 'text',
value: 'a',
children: [{
type: 'sup',
children: [{
type: 'text',
value: 'x'
}]
}]
}]
},
{
type: 'paragraph',
children: [{
type: 'text',
value: 'x',
children: [{
type: 'sub',
children: [{
type: 'text',
value: 'i'
}]
}]
}]
}
This plugin is compatible with rehype. Sub
mdast nodes will become <sub>contents</sub>
, Sup
mdast nodes will become <sup>contents</sup>
.
npm:
npm install remark-sub-super
Dependencies:
const unified = require('unified')
const remarkParse = require('remark-parse')
const stringify = require('rehype-stringify')
const remark2rehype = require('remark-rehype')
const remarkSubSuper = require('remark-sub-super')
Usage:
unified()
.use(remarkParse)
.use(remarkSubSuper)
.use(remark2rehype)
.use(stringify)
FAQs
This plugin parses custom Markdown syntax to handle subscript and superscript. It adds new nodes types to the [mdast][mdast] produced by [remark][remark]:
We found that remark-sub-super demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers 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
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.