Class: Bidify::HtmlStringBidifier
- Defined in:
- lib/bidify/html_string_bidifier.rb
Overview
Bidifying html input as string
Example Usage
Here’s an example of how to use the class:
bidifier = HtmlStringBidifier.new
bidifier.apply("<p>text</p>")
Instance Method Summary collapse
-
#apply(html_input) ⇒ String
Applies dir=“auto” to the given html string with default configuration.
Methods inherited from Bidifier
Constructor Details
This class inherits a constructor from Bidify::Bidifier
Instance Method Details
#apply(html_input) ⇒ String
Applies dir=“auto” to the given html string with default configuration
24 25 26 27 28 29 |
# File 'lib/bidify/html_string_bidifier.rb', line 24 def apply(html_input) html_node = Nokogiri::HTML.fragment(html_input) bidify_recursively(html_node, { root: true }) html_node.to_s end |