
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
rehype-tree-sitter-highlight
Advanced tools
highlight your code using tree-sitter-highlight
npm install rehype-tree-sitter-highlight
This is a rehype plugin. To highlight code blocks in html:
import fromHtml from 'rehype-parse'
import toHtml from 'rehype-stringify'
import rehypeTreeSitterHighlight from 'rehype-tree-sitter-highlight'
import { unified } from 'unified'
const doc = "```js\nconst hello = 'World';\n```\n"
async function createProcessor() {
const processor = unified()
.use(fromHtml)
.use(rehypeTreeSitterHighlight)
.use(toHtml)
return processor
}
const processor = await createProcessor()
const vfile = await processor.process(doc)
console.log(vfile.toString())
Refer to the tree-sitter-highlight docs for information on how to theme the output html.
Refer to the tree-sitter-highlight for supported languages.
Unknown languages are ignored by default. You can set ignoreUnknownLanguage: false
to throw an error when an unsupported language is encountered.
See examples for ways to use this plugin.
Much of the docs and code is taken from rehype-shiki.
FAQs
highlight your code using tree-sitter-highlight
The npm package rehype-tree-sitter-highlight receives a total of 0 weekly downloads. As such, rehype-tree-sitter-highlight popularity was classified as not popular.
We found that rehype-tree-sitter-highlight 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.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.