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.
@cartamd/plugin-code
Advanced tools
This plugin adds support for code blocks **syntax highlighting**. It uses the same highlighter from the core package(Shiki).
This plugin adds support for code blocks syntax highlighting. It uses the same highlighter from the core package(Shiki).
npm i @cartamd/plugin-code
Import the default styles:
import '@cartamd/plugin-code/default.css';
Carta comes with a default highlighter that matches the one used to highlight markdown in the editor and is used by default (Shiki). If you want to use a theme different from the one used to highlight Markdown, you can specify it in the options. Remember to also have it loaded into the highlighter, by specifying it in shikiOptions
.
const carta = new Carta({
// ...
extensions: [
code({
theme: 'ayu-light'
})
],
shikiOptions: {
themes: ['ayu-light']
}
});
It is no longer possible to specify a custom highlighter in this plugin. However, there are many different Remark plugins that provide syntax highlighting.
<script lang="ts">
import { Carta, MarkdownEditor } from 'carta-md';
import { code } from '@cartamd/plugin-code';
const carta = new Carta({
extensions: [code()]
});
</script>
<MarkdownEditor {carta} />
Checkout the docs for examples, options and more.
FAQs
This plugin adds support for code blocks **syntax highlighting**. It uses the same highlighter from the core package(Shiki).
The npm package @cartamd/plugin-code receives a total of 570 weekly downloads. As such, @cartamd/plugin-code popularity was classified as not popular.
We found that @cartamd/plugin-code demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.