
Security News
Open Source Maintainers Demand Ability to Block Copilot-Generated Issues and PRs
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
markdown-it-shiki-twoslash
Advanced tools
A markdown-it plugin for Shiki with Twoslash code samples
Sets up markdown code blocks to run through shiki which means it gets the VS Code quality syntax highlighting mixed with the twoslash JavaScript tooling from the TypeScript website.
Install the dependency: yarn add markdown-it-shiki-twoslash
Include "markdown-it-shiki-twoslash"
in the plugins section of the markdown-it parser:
import shikiTwoslash from "markdown-it-shiki-twoslash"
import MarkdownIt from "markdown-it"
const md = MarkdownIt()
md.use(shikiTwoslash, { theme: "nord" })
const html = md.render(file)
or even better:
import { markdownItShikiTwoslashSetup } from "markdown-it-shiki-twoslash"
import MarkdownIt from "markdown-it"
const md = MarkdownIt()
const shiki = await markdownItShikiTwoslashSetup({
theme: "nord",
})
md.use(shiki)
const html = md.render(file)
Because shiki uses WASM to handle the syntax highlighting, it has to be async code, this clashes with the markdown-it API which enforces synchronous code. In the first code sample, the plugin uses deasync
to convert that async work to sync. It's safe to say that you probably don't want deasync'd code in critical systems.
Follow the steps in npmjs.com/package/remark-shiki-twoslash to add the CSS requirements.
Follow the instructions on npmjs.com/package/remark-shiki-twoslash, this module leaves all the heavy lifting to that module.
FAQs
A markdown-it plugin for Shiki with Twoslash code samples
The npm package markdown-it-shiki-twoslash receives a total of 69 weekly downloads. As such, markdown-it-shiki-twoslash popularity was classified as not popular.
We found that markdown-it-shiki-twoslash demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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.
Security News
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
Research
Security News
Malicious Koishi plugin silently exfiltrates messages with hex strings to a hardcoded QQ account, exposing secrets in chatbots across platforms.
Research
Security News
Malicious PyPI checkers validate stolen emails against TikTok and Instagram APIs, enabling targeted account attacks and dark web credential sales.