lib/utils/xml.rb in metanorma-utils-1.4.5 vs lib/utils/xml.rb in metanorma-utils-1.4.6
- old
+ new
@@ -56,10 +56,12 @@
def noko_html(&block)
doc = ::Nokogiri::XML.parse(NOKOHEAD)
fragment = doc.fragment("")
::Nokogiri::XML::Builder.with fragment, &block
- fragment.to_xml(encoding: "US-ASCII").lines.map do |l|
+ fragment.to_xml(encoding: "US-ASCII", indent: 0,
+ save_with: Nokogiri::XML::Node::SaveOptions::AS_XML)
+ .lines.map do |l|
l.gsub(/\s*\n/, "")
end
end
def to_xhtml_fragment(xml)