Class: Html2Doc
- Inherits:
-
Object
- Object
- Html2Doc
- Defined in:
- lib/html2doc/xml.rb,
lib/html2doc/base.rb,
lib/html2doc/math.rb,
lib/html2doc/mime.rb,
lib/html2doc/lists.rb,
lib/html2doc/notes.rb,
lib/html2doc/version.rb
Constant Summary collapse
- NOKOHEAD =
<<~HERE.freeze <!DOCTYPE html SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <meta charset="UTF-8" /> </head> <body> </body> </html> HERE
- DOCTYPE =
<<~DOCTYPE.freeze <!DOCTYPE html SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> DOCTYPE
- PRINT_VIEW =
<<~XML.freeze <xml> <w:WordDocument> <w:View>Print</w:View> <w:Zoom>100</w:Zoom> <w:DoNotOptimizeForBrowser/> </w:WordDocument> </xml> <meta http-equiv='Content-Type' content="text/html; charset=utf-8"/> XML
- MATHML_NS =
"http://www.w3.org/1998/Math/MathML".freeze
- HTML_NS =
'xmlns="http://www.w3.org/1999/xhtml"'.freeze
- OOXML_NS =
"http://schemas.openxmlformats.org/officeDocument/2006/math".freeze
- STYLE_BEARING_NODE =
%w(p div td th li).map { |x| ".//ancestor::#{x}" }.join(" | ").freeze
- IMAGE_PATH =
"//*[local-name() = 'img' or local-name() = 'imagedata']".freeze
- IMAGE_IMAGEDATA =
".//*[local-name() = 'img' or local-name() = 'imagedata']".freeze
- TOPLIST =
"[not(ancestor::ul) and not(ancestor::ol)]".freeze
- FN =
"<span class='MsoFootnoteReference'>"\ "<span style='mso-special-character:footnote'/></span>".freeze
- VERSION =
"1.12.0".freeze
Instance Method Summary collapse
- #accent_tr(xml) ⇒ Object
- #accent_tr1(accent) ⇒ Object
- #add_stylesheet(head, title, css) ⇒ Object
- #bookmarks(docxml) ⇒ Object
- #cleanup(docxml) ⇒ Object
- #clear_dir(dir) ⇒ Object
- #contentid(mhtml) ⇒ Object
- #create_dir(filename, dir) ⇒ Object
- #define_head(docxml) ⇒ Object
- #define_head1(docxml, _dir) ⇒ Object
- #derive_liststyle(list, liststyle, level) ⇒ Object
- #encode_math(elem) ⇒ Object
-
#escape_amp_in_hrefs(html) ⇒ Object
Escape plain & to & in href attributes This prevents Nokogiri from stripping invalid HTML entities during XML parsing.
- #filename_substitute(head, header_filename) ⇒ Object
-
#find_page_size(stylesheet, klass, in_xml) ⇒ Object
if in_xml, CSS is embedded in XML