Security News
The Push to Ban Ransom Payments Is Gaining Momentum
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
remark-sub-super
Advanced tools
Readme
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
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
Application Security
New SEC disclosure rules aim to enforce timely cyber incident reporting, but fear of job loss and inadequate resources lead to significant underreporting.
Security News
The Python Software Foundation has secured a 5-year sponsorship from Fastly that supports PSF's activities and events, most notably the security and reliability of the Python Package Index (PyPI).