Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
The remark npm package is a powerful, extensible Markdown processor built on the unified collective ecosystem. It allows for parsing, transforming, and compiling Markdown content with a focus on syntax trees. Remark can be used for a variety of tasks such as linting Markdown, transforming the syntax for different purposes, or extracting metadata from documents.
Parsing Markdown to Syntax Trees
This feature allows users to parse Markdown content into an abstract syntax tree (AST), enabling programmatic analysis and manipulation of the content.
const remark = require('remark');
const markdown = 'Some **Markdown** text.';
remark().parse(markdown);
Transforming Syntax Trees
With this feature, users can transform the syntax tree generated from Markdown content. For example, converting the tree to HTML by using the remark-html plugin.
const remark = require('remark');
const html = require('remark-html');
const markdown = 'Some **Markdown** text.';
remark().use(html).processSync(markdown).toString();
Linting Markdown
This feature enables users to lint their Markdown content for style and syntax issues, ensuring consistency and quality in their Markdown files.
const remark = require('remark');
const recommended = require('remark-preset-lint-recommended');
const report = require('vfile-reporter');
remark().use(recommended).process('_Emphasis_ and **importance**', (err, file) => {
console.error(report(err || file));
});
markdown-it is a fast and extensible Markdown parser that can render HTML. It is similar to remark in its extensibility but focuses more on speed and adherence to the CommonMark specification without an emphasis on abstract syntax trees.
showdown is another Markdown to HTML converter that can run both in the browser and on the server. Unlike remark, which is built around a plugin ecosystem and AST manipulation, showdown focuses on configurability and extension through a different type of extension mechanism.
marked is a low-level Markdown compiler for parsing Markdown without caching or blocking for files. It is designed for speed and is simpler in scope compared to remark, which offers a broader range of processing capabilities through its plugins and unified ecosystem.
Forward-looking Markdown editor built in React
remark
npm package has recently changed!If you're looking for jongleberry's remark
project, you can install with npm install remark@0.0.1
.
remark
exposes a render method from the main package.
var remark = require('remark');
var editor = remark(document.getElementById('editor'));
Layout of the component is controlled by CSS Flexbox and works best if placed in an element with display: flex
styling.
/* Full Page editor */
body {
display: flex;
min-height: 100vh;
}
var remark = require('remark');
var editor = remark(document.body);
The React component is available as remark/component
.
var React = require('react');
var Remark = require('remark/component');
var editor = React.renderComponent(Remark(), document.getElementById('editor'));
Tested in Chrome 35, Safari 6.1.1, and Firefox 29.
Internet Explorer 10 & 11 should also be supported but are untested currently.
MIT
FAQs
markdown processor powered by plugins part of the unified collective
The npm package remark receives a total of 1,499,451 weekly downloads. As such, remark popularity was classified as popular.
We found that remark 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
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.