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.
Transform html into markdown. Useful for example if you want to import html into your markdown based application.
See Change Log
Install the gem
[sudo] gem install reverse_markdown
or add it to your Gemfile
gem 'reverse_markdown'
h1
, h2
, h3
, h4
, h5
, h6
, p
, em
, strong
, i
, b
, blockquote
, code
, img
, a
, hr
, li
, ol
, ul
, table
, tr
, th
, td
, br
, figure
You can convert html content as string or Nokogiri document:
input = '<strong>feelings</strong>'
result = ReverseMarkdown.convert input
result.inspect # " **feelings** "
It's also possible to convert html files to markdown using the binary:
$ reverse_markdown file.html > file.md
$ cat file.html | reverse_markdown > file.md
The following options are available:
unknown_tags
(default pass_through
) - how to handle unknown tags. Valid options are:
pass_through
- Include the unknown tag completely into the resultdrop
- Drop the unknown tag and its contentbypass
- Ignore the unknown tag but try to convert its contentraise
- Raise an error to let you knowgithub_flavored
(default false
) - use github flavored markdown (yet only code blocks are supported)tag_border
(default ' '
) - how to handle tag borders. valid options are:
' '
- Add whitespace if there is none at tag borders.''
- Do not not add whitespace.Just pass your chosen configuration options in after the input. The given options will last for this operation only.
ReverseMarkdown.convert(input, unknown_tags: :raise, github_flavored: true)
Or configure it block style on a initializer level. These configurations will last for all conversions until they are set to something different.
ReverseMarkdown.config do |config|
config.unknown_tags = :bypass
config.github_flavored = true
config.tag_border = ''
end
Thanks to all contributors and all other helpers:
FAQs
Unknown package
We found that reverse_markdown demonstrated a healthy version release cadence and project activity because the last version was released less than 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.