Class: RubyDocx::Htmls::Parser
- Inherits:
-
Object
- Object
- RubyDocx::Htmls::Parser
- Defined in:
- lib/ruby_docx/htmls.rb
Constant Summary collapse
- ELEMENTS_ALIAS =
{ "p" => RubyDocx::Htmls::HtmlParagraph, "span" => RubyDocx::Htmls::HtmlText, "div" => RubyDocx::Htmls::HtmlParagraph, "br" => RubyDocx::Htmls::HtmlBreakLine, "img" => RubyDocx::Htmls::HtmlImage, "table" => RubyDocx::Htmls::HtmlTable, "th" => RubyDocx::Htmls::HtmlTableHeader, "tr" => RubyDocx::Htmls::HtmlTableRow, "td" => RubyDocx::Htmls::HtmlTableCell, "a" => RubyDocx::Htmls::HtmlLink, }
Class Method Summary collapse
Class Method Details
.parse_by_name(doc, c_node) ⇒ Object
23 24 25 26 27 28 |
# File 'lib/ruby_docx/htmls.rb', line 23 def self.parse_by_name(doc, c_node) if ELEMENTS_ALIAS.keys.index(c_node.name.to_s) ELEMENTS_ALIAS[c_node.name.to_s].new(doc, c_node) end end |