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.
remark-align
Advanced tools
This plugin parses custom Markdown syntax to center- or right-align elements.
This plugin parses custom Markdown syntax to center- or right-align elements.
It adds three new node types, described below, to the mdast produced by remark:
LeftAligned
interface LeftAligned <: Parent {
type: "leftAligned";
data: {
hName: "div";
hProperties: {
class: string;
}
}
}
CenterAligned
interface CenterAligned <: Parent {
type: "centerAligned";
data: {
hName: "div";
hProperties: {
class: string;
}
}
}
RightAligned
interface RightAligned <: Parent {
type: "rightAligned";
data: {
hName: "div";
hProperties: {
class: string;
}
}
}
If you are using rehype, the stringified HTML result will be div
s with configurable CSS classes.
It is up to you to have CSS rules producing the desired result for these three classes.
Alignment is done by wrapping something in arrows indicating the alignment:
->paragraph<-
->paragraph->
produces:
<div class="some-class"><p>paragraph</p></div>
<div class="some-other-class"><p>paragraph</p></div>
npm:
npm install remark-align
Dependencies:
const unified = require('unified')
const remarkParse = require('remark-parse')
const stringify = require('rehype-stringify')
const remark2rehype = require('remark-rehype')
const remarkAlign = require('remark-align')
Usage:
unified()
.use(remarkParse)
.use(remarkAlign, {
left: 'align-left',
center: 'align-center',
right: 'align-right',
})
.use(remark2rehype)
.use(stringify)
FAQs
This plugin parses custom Markdown syntax to center- or right-align elements.
The npm package remark-align receives a total of 437 weekly downloads. As such, remark-align popularity was classified as not popular.
We found that remark-align 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
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.