Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
remark-custom-blocks
Advanced tools
This plugin parses custom Markdown syntax to create new custom blocks. It adds new nodes types to the [mdast][mdast] produced by [remark][remark]:
This plugin parses custom Markdown syntax to create new custom blocks. It adds new nodes types to the mdast produced by remark:
{yourType}CustomBlock
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 classes.
[[yourType]]
| Here goes the content. Content gets parsed,
| so you could use quotes or anything inside of them:
| > Hello **World**!
produces:
<div class="some-class some-other-class"><p>Here goes the content. Content gets parsed,
so you could use quotes or anything inside of them:
</p>
<blockquote><p>Hello <strong>World</strong>!</blockquote></div>
with the following configuration object:
{
yourType: 'some-class some-other-class',
}
npm:
npm install remark-custom-blocks
Dependencies:
const unified = require('unified')
const remarkParse = require('remark-parse')
const stringify = require('rehype-stringify')
const remark2rehype = require('remark-rehype')
const remarkCustomBlocks = require('remark-custom-blocks')
Usage:
unified()
.use(remarkParse)
.use(remarkCustomBlocks, {
someType: 'a-css-class another-class',
anotherType: 'foo',
})
.use(remark2rehype)
.use(stringify)
As you can see, configuration is an object Type: 'space separated classes'
.
The sample configuration provided above would have the following effect:
Allows you to use the following Markdown syntax to create blocks:
[[someType]]
| content
[[anotherType]]
| content
This Remark plugin would create mdast nodes for these two blocks, these nodes would be of type:
someTypeCustomBlock
anotherTypeCustomBlock
If you're using rehype, you will end up with div
s like these:
<div class="a-css-class another-class">…
<div class="foo">…
FAQs
This plugin parses custom Markdown syntax to create new custom blocks. It adds new nodes types to the [mdast][mdast] produced by [remark][remark]:
The npm package remark-custom-blocks receives a total of 1,498 weekly downloads. As such, remark-custom-blocks popularity was classified as popular.
We found that remark-custom-blocks 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
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.