A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/xijo/reverse_markdown below:

xijo/reverse_markdown: Ruby gem to convert html into markdown

Transform html into markdown. Useful for example if you want to import html into your markdown based application.

See Change Log

  1. Nokogiri
  2. Ruby 2.7.0 or higher

Install the gem

[sudo] gem install reverse_markdown

or add it to your Gemfile

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:

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:


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4