
Research
/Security News
Contagious Interview Campaign Escalates With 67 Malicious npm Packages and New Malware Loader
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.
= Markup Parser
Creating my own rails wiki application forced me to do some research on markup parsers. I ended up using a ton of Github solutions (and code) but in the end found their 'markup' gem to be a little cumbersome and behind some of the new advances (specifically Redcarpet 2)
So I created my own little library.
List the available markup parsers:
MarkupParser.format_parsers #=> { 'markdown' => MarkupParser::Markdown, 'rdoc' => MarkupParser::Rdoc }
Parse some text to Html:
MarkupParser::Markdown.new("body").to_html #=> "<p>body<p>"
Note that the MarkupParser::Markdown
is the parser for Markdown, and can be reused by just creating a new instance.
Another goal was to simplify code block styling. MarkupParser doesn't stylize the code, but instead lets you easily accomplish it with your own code styler:
markup = MarkupParser::Html.new("<pre lang='ruby'>Class</pre>")
markup.stylize_code_blocks { |code, lang|
Albino.colorize(code, lang)
}
markup.to_html #=> "<pre class='highlight'><span class='class'>Class</span></pre>"
Or:
MarkupParser::Html.new("<pre lang='ruby'>Class</pre>").stylize_code_blocks { |code, lang|
Albino.colorize(code, lang)
}.to_html #=> "<pre class='highlight'><span class='class'>Class</span></pre>"
For each code block recognized by the markup language, stylize_code_blocks
accepts a block with parameters: code, lang
for you to use.
Ask me (Todo)
FAQs
Unknown package
We found that markup_parser 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
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.