Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
When I write blog posts and tutorials I include many code samples and apply syntax highlighting to increase readability. For that I use Alex Gorbatchev's excellent SyntaxHighlighter Javascript library. But if I am interested in creating eBooks the challenge is to maintain the highlighting. Since the markup needs to be all inclusive, I need a "pre-processor" to take my markup and apply syntax highlighting so that the final XHTML can be used for the eBook.
highlight-code is a small Ruby utility which will take a XHTML document as input and apply syntax highlighting and save the resulting XHTML in an output file.
Actually this is really a command line utility built "on the shoulders of giants", i.e. Nokogiri and CodeRay. "They" do the heavy lift, I am just assembling them into a utility to help me apply syntax highlighting to XHTML markup containing code samples (in pre/code tags).
gem install highlight-code
highligh-code test.xhtml
highlight-code XHTMLFILEPATH [OPTIONS]
XHTMLFILEPATH: The .xhtml file containing the code to highlight
OPTIONS:
-c, --css-path PATH/TO/CSS/FILES path for the coderay.css (default same location as the input file)
-e, --extension EXTENSION extension for the processed / output file (default: .highlighted.xhtml)
-t, --tag TAG type of tag (pre or code) containing the code to highlight
(note: the css class must follow the syntax: brush: language, e.g. brush: ruby)
(default: both)
-h, --help help
FAQs
Unknown package
We found that highlight-code 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.