
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
= 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.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.