Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@mapbox/babel-plugin-transform-jsxtreme-markdown
Advanced tools
Transform Markdown interpolated with JS expressions and JSX elements at compile time
🚧 🚧 EXPERIMENTAL! WORK IN PROGRESS! 🚧 🚧
Transform Markdown interpolated with JS expressions and JSX elements into pure JSX, at compile time.
Uses jsxtreme-markdown to compile the interpolated Markdown.
Transforms a special tagged template literal.
require
or import
'babel-plugin-transform-jsxtreme-markdown/md'
, or whatever you've specified as packageName
in your Babel options.
Then use that (fake) module's value as a template literal tag, marking the template literals you'd like to be compiled at run time.
// Input
const md = require('babel-plugin-transform-jsxtreme-markdown/md');
const foo = md`
# Title
This is **bold.**
Here is a [link](/some/url).
`;
// Output
'use strict';
var foo = <div>
<h1>Title</h1>
<p>This is <strong>bold.</strong>
Here is a <a href="/some/url">link</a>.</p>
</div>;
Because this plugin uses jsxtreme-markdown, you can also interpolate JS expressions and JSX elements within special delimiters. Read more about this in the jsxtreme-markdown docs.
// Input
const md = require('babel-plugin-transform-jsxtreme-markdown/md');
const text = md`
This is a paragraph {{<span className="foo">}} with a **markdown** span inside {{</span>}}
{{ <div style={{ margin: 70 }}> }}
And here is a *paragraph* inside a div.
[Link](/some/url)
{{ </div> }}
`;
// Output
'use strict';
var text = <div>
<p>This is a paragraph <span className="foo"> with a <strong>markdown</strong> span inside </span></p>
<div style={{ margin: 70 }}>
And here is a <em>paragraph</em> inside a div.
<a href="/some/url">Link</a>
</div>
</div>;
You can pass any of the options available to jsxtremeMarkdown.toJsx
.
Additional options:
?string
- Default: 'babel-plugin-transform-jsxtreme-markdown/md'
.
The name of the package that you will require
or import
to use this thing.FAQs
Transform Markdown interpolated with JS expressions and JSX elements at compile time
The npm package @mapbox/babel-plugin-transform-jsxtreme-markdown receives a total of 357 weekly downloads. As such, @mapbox/babel-plugin-transform-jsxtreme-markdown popularity was classified as not popular.
We found that @mapbox/babel-plugin-transform-jsxtreme-markdown demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 28 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.