
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
mdast-comment-marker
Advanced tools
mdast utility to parse comment markers.
npm:
npm install mdast-comment-marker
var marker = require('mdast-comment-marker');
console.log(marker({
type: 'html',
value: '<!--foo-->'
}));
console.log(marker({
type: 'html',
value: '<!--foo bar baz=12.4 qux="test test" quux=\'false\'-->'
}));
console.log(marker({
type: 'html',
value: '<!doctype html>'
}));
// Also supports MDX comment nodes.
console.log(marker({
type: 'comment',
value: 'bar'
}));
Yields:
{ name: 'foo',
attributes: '',
parameters: {},
node: { type: 'html', value: '<!--foo-->' } }
{ name: 'foo',
attributes: 'bar baz=12.4 qux="test test" quux=\'false\'',
parameters: { bar: true, baz: 12.4, qux: 'test test', quux: false },
node:
{ type: 'html',
value: '<!--foo bar baz=12.4 qux="test test" quux=\'false\'-->' } }
null
{ name: 'bar',
attributes: '',
parameters: {},
node: { type: 'comment', value: 'bar' } }
marker(node)
Parse a comment marker.
Marker?
— Information, when applicable.
Marker
A comment marker.
name
(string
) — Name of markerattributes
(string
) — Value after nameparameters
(Object
) — Parsed attributes, tries to convert
values to numbers and booleans when possiblenode
(Node
) — Reference to given nodeUse of mdast-comment-marker
does not involve hast, user content,
or change the tree, so there are no openings for
cross-site scripting (XSS) attacks.
See contributing.md
in syntax-tree/.github
for ways to get
started.
See support.md
for ways to get help.
This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.
FAQs
mdast utility to parse a comment marker
The npm package mdast-comment-marker receives a total of 181,831 weekly downloads. As such, mdast-comment-marker popularity was classified as popular.
We found that mdast-comment-marker demonstrated a not healthy version release cadence and project activity because the last version was released 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.