Module: Bidify

Defined in:
lib/bidify.rb,
lib/bidify/version.rb

Overview

Bidify applies ‘dir=“auto”` to the given html string

### Example:

bidified_html = Bidify.bidify(regular_html)

Constant Summary collapse

VERSION =
'0.1.1'

Class Method Summary collapse

Class Method Details

.bidify(input_html) ⇒ Object

bidify applies dir=“auto” to the given html string



16
17
18
19
20
21
# File 'lib/bidify.rb', line 16

def bidify(input_html)
  html_node = Nokogiri::HTML.fragment(input_html)
  bidify_recursively(html_node, { root: true })

  html_node.to_s
end