
Security News
AI Agent Lands PRs in Major OSS Projects, Targets Maintainers via Cold Outreach
An AI agent is merging PRs into major OSS projects and cold-emailing maintainers to drum up more work.
@soldair/highlights
Advanced tools

Reads in code, writes out HTML with CSS classes based on the tokens in the code.
See it in action here.
npm install highlights
Run highlights -h for full details about the supported options.
To convert a source file to tokenized HTML run the following:
highlights file.coffee -o file.html
Now you have a file.html file that has a big <pre> tag with a <div> for
each line with <span> elements for each token.
Then you can compile an existing Atom theme into a stylesheet with the following:
git clone https://github.com/atom/atom-dark-syntax
cd atom-dark-syntax
npm install -g less
lessc --include-path=styles index.less atom-dark-syntax.css
Now you have an atom-dark-syntax.css stylesheet that be combined with
the file.html file to generate some nice looking code.
Check out the examples to see it in action.
Check out atom.io to find more themes.
Some popular themes:
Highlights = require 'highlights'
highlighter = new Highlights()
html = highlighter.highlightSync
fileContents: 'var hello = "world";'
scopeName: 'source.js'
console.log html
Outputs:
<pre class="editor editor-colors">
<div class="line">
<span class="source js">
<span class="storage modifier js"><span>var</span></span>
<span> hello </span>
<span class="keyword operator js"><span>=</span></span>
<span> </span>
<span class="string quoted double js">
<span class="punctuation definition string begin js"><span>"</span></span>
<span>world</span>
<span class="punctuation definition string end js"><span>"</span></span>
</span>
<span class="punctuation terminator statement js"><span>;</span></span>
</span>
</div>
</pre>
highlights exposes the method requireGrammarsSync, for loading grammars from
npm modules. The usage is as follows:
npm install atom-language-clojure
Highlights = require 'highlights'
highlighter = new Highlights()
highlighter.requireGrammarsSync
modulePath: require.resolve('atom-language-clojure/package.json')
git clone https://github.com/atom/highlightsgit submodule update --init --recursivenpm install to install the dependencies, compile the CoffeeScript, and
build the grammarsnpm test to run the specs:green_heart: Pull requests are greatly appreciated and welcomed.
FAQs
Syntax highlighter
We found that @soldair/highlights 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.

Security News
An AI agent is merging PRs into major OSS projects and cold-emailing maintainers to drum up more work.

Research
/Security News
Chrome extension CL Suite by @CLMasters neutralizes 2FA for Facebook and Meta Business accounts while exfiltrating Business Manager contact and analytics data.

Security News
After Matplotlib rejected an AI-written PR, the agent fired back with a blog post, igniting debate over AI contributions and maintainer burden.