
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.
@elboman/remark-jsx
Advanced tools
[](https://www.npmjs.com/package/@elboman/remark-jsx) [](license)
Add support for JSX custom components in remark markdown using a whitelist of Elements. They are parsed along with their props to be rendered later with React or any framework of that sort.
NB: This package is a fork of @dumpster/remark-custom-element-to-hast created in order to enhance JSX parsing to support expressions, converted code to ES6 syntax and updated the test suit with more comprehensive tests.
import unified from 'unified';
import remark from 'remark-parse';
import remarkJsx from '@elboman/remark-jsx';
const processor = unified()
.use(parseMD)
.use(remarkJsx, {
componentWhitelist: ['CustomComponent'],
});
const output = processor.processSync(
`# Hello World
<CustomComponent withProps={'somestring'} />
<CustomComponent someExpression={15 + 32} />
`
);
The above example will output:
{
"type": "root",
"children": [
{
"type": "element",
"tagName": "h1",
"properties": {},
"children": [
{
"type": "text",
"value": "Hello World"
}
]
},
{
"type": "element",
"tagName": "CustomComponent",
"properties": {
"withProps": {
"value": "somestring",
"type": "string"
}
},
"children": []
},
{
"type": "element",
"tagName": "CustomComponent",
"properties": {
"someExpression": {
"value": "15+32",
"type": "expression"
}
},
"children": []
}
]
}
FAQs
[](https://www.npmjs.com/package/@elboman/remark-jsx) [](license)
The npm package @elboman/remark-jsx receives a total of 3 weekly downloads. As such, @elboman/remark-jsx popularity was classified as not popular.
We found that @elboman/remark-jsx demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.