lib/asciidoctor/csand/converter.rb in metanorma-csand-1.1.0 vs lib/asciidoctor/csand/converter.rb in metanorma-csand-1.1.1

- old
+ new

@@ -82,11 +82,11 @@ result = ["<?xml version='1.0' encoding='UTF-8'?>\n<csand-standard>"] @draft = node.attributes.has_key?("draft") result << noko { |ixml| front node, ixml } result << noko { |ixml| middle node, ixml } result << "</csand-standard>" - result = textcleanup(result.flatten * "\n") + result = textcleanup(result) ret1 = cleanup(Nokogiri::XML(result)) validate(ret1) ret1.root.add_namespace(nil, CSAND_NAMESPACE) ret1 end @@ -107,10 +107,12 @@ unless node.attr("nodoc") || !node.attr("docfile") filename = node.attr("docfile").gsub(/\.adoc/, ".xml"). gsub(%r{^.*/}, "") File.open(filename, "w") { |f| f.write(ret) } html_converter(node).convert filename unless node.attr("nodoc") + pdf_converter(node).convert filename unless node.attr("nodoc") + word_converter(node).convert filename unless node.attr("nodoc") end @files_to_delete.each { |f| FileUtils.rm f } ret end @@ -131,9 +133,15 @@ return end def html_converter(node) IsoDoc::Csand::HtmlConvert.new(html_extract_attributes(node)) + end + def pdf_converter(node) + IsoDoc::Csand::PdfConvert.new(html_extract_attributes(node)) + end + def word_converter(node) + IsoDoc::Csand::WordConvert.new(doc_extract_attributes(node)) end end end end