Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
blueprint-markdown-renderer
Advanced tools
Default parser and set of settings for parsing and rendering Markdown blocks in API Blueprint
Default parser and set of settings for parsing and rendering of Markdown blocks in API Description Documents.
$ npm install blueprint-markdown-renderer
import { renderHtml } from 'blueprint-markdown-renderer';
const mdText = '# Heading';
const html = renderHtml(mdText);
console.log("Rendered HTML: ", html);
Note that if you alter renderer's settings, you are potentially diverging from the ecosystem, therefore this is not encouraged. However, it's still better to share the same rendering core with customised behaviour than it is to start for the blank slate.
Blueprint Markdown Renderer uses markdown-it under the hood. See markdown-it API Documentation to find all available options how to change renderer.
import { renderHtml, rendererFactory, sanitize } from 'blueprint-markdown-render';
import emojiPlugin from 'markdown-it-emoji';
const renderer = rendererFactory();
// alter default options
renderer.set({ langPrefix: 'lang-', breaks: true });
// add own plugin
renderer.use(emojiPlugin);
const mdText = ':smiley:';
const html = renderHtml(mdText, {
renderer, // custom renderer
env, // additional data from parsed input (references, for example)
sanitize, // run HTML sanitization function
});
console.log("Rendered HTML: ", html);
While API Blueprint syntax is based on Markdown, it doesn't care about the (Markdown) content of description blocks. The reference parser actually preserves the source Markdown in the produced API Elements. Same logic applies to
This library is intended to provide a consistent API for parsing those Markdown blocks. Use it to get the same defaults and consistent rendering with the rest of JavaScript API Blueprint ecosystem.
To get consistent experience accross languages, this library uses CommonMark implementation under its hood. Following extensions to default rendering is enabled by default:
$ npm install
$ npm test
This package is using Semantic Release.
Please use proper commit message format.
MIT (see LICENSE
file)
Apiary Czech Republic, s.r.o. support@apiary.io
FAQs
Default parser and set of settings for parsing and rendering Markdown blocks in API Blueprint
The npm package blueprint-markdown-renderer receives a total of 1 weekly downloads. As such, blueprint-markdown-renderer popularity was classified as not popular.
We found that blueprint-markdown-renderer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.