
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
@cartamd/plugin-code
Advanced tools
This plugin adds support for code blocks **syntax highlighting**. Install it using:
This plugin adds support for code blocks syntax highlighting. Install it using:
npm i @cartamd/plugin-code
This is done using Speed-highlight JS, which supports dynamic imports. This way, languages definitions are only imported at the moment of need.
Import the default styles:
import '@cartamd/plugin-code/default.css';
Here you can find other themes. The theme matches the one used in the main carta package (carta-md/light.css
or carta-md/dark.css
), so you need to remove it before adding any other.
<script lang="ts">
import { Carta, CartaEditor } from 'carta-md';
import { code } from '@cartamd/plugin-code';
const carta = new Carta({
extensions: [code()]
});
</script>
<CartaEditor {carta} />
Here are the options you can pass to code()
:
interface CodeExtensionOptions {
/**
* Default language when none is provided.
*/
defaultLanguage?: string;
/**
* Whether to autodetect a language when none is provided.
* Overwritten by `defaultLanguage`.
*/
autoDetect?: string;
/**
* Line numbering.
* @defaults false.
*/
lineNumbering?: boolean;
}
FAQs
This plugin adds support for code blocks **syntax highlighting**. It uses the same highlighter from the core package(Shiki).
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 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.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.