
Security News
Follow-up and Clarification on Recent Malicious Ruby Gems Campaign
A clarification on our recent research investigating 60 malicious Ruby gems.
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
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.
Research
/Security News
A malicious Go module posing as an SSH brute forcer exfiltrates stolen credentials to a Telegram bot controlled by a Russian-speaking threat actor.