lib/asciidoctor/iso/blocks.rb in asciidoctor-iso-0.7.0 vs lib/asciidoctor/iso/blocks.rb in asciidoctor-iso-0.7.1

- old
+ new

@@ -26,12 +26,11 @@ # NOTE: html escaping is performed by Nokogiri def stem(node) stem_content = node.lines.join("\n") noko do |xml| xml.formula **id_attr(node) do |s| - s.stem stem_content, **{ type: "AsciiMath" } - style(node, stem_content) + stem_parse(stem_content, s) end end end def sidebar_attrs(node) @@ -57,21 +56,18 @@ def termnote(n) noko do |xml| xml.termnote **id_attr(n) do |ex| wrap_in_para(n, ex) - style(n, Utils::flatten_rawtext(n.content).join("\n")) end end.join("\n") end def note(n) noko do |xml| xml.note **id_attr(n) do |c| wrap_in_para(n, c) - text = Utils::flatten_rawtext(n.content).join("\n") - note_style(n, text) end end.join("\n") end def admonition_attrs(node) @@ -83,11 +79,11 @@ end { id: Utils::anchor_or_uuid(node), type: name } end def admonition(node) - return termnote(node) if in_terms + return termnote(node) if in_terms? return note(node) if node.attr("name") == "note" noko do |xml| xml.admonition **admonition_attrs(node) do |a| wrap_in_para(node, a) end @@ -95,38 +91,31 @@ end def term_example(node) noko do |xml| xml.termexample **id_attr(node) do |ex| - c = node.content wrap_in_para(node, ex) - text = Utils::flatten_rawtext(c).join("\n") - termexample_style(node, text) end end.join("\n") end def example(node) - return term_example(node) if in_terms + return term_example(node) if in_terms? noko do |xml| xml.example **id_attr(node) do |ex| content = node.content ex << content - text = Utils::flatten_rawtext(content).join("\n") - termexample_style(node, text) end end.join("\n") end def preamble(node) noko do |xml| xml.foreword do |xml_abstract| xml_abstract.title { |t| t << "Foreword" } content = node.content xml_abstract << content - text = Utils::flatten_rawtext(content).join("\n") - foreword_style(node, text) end end.join("\n") end def image_attributes(node) @@ -138,13 +127,11 @@ height: node.attr("height"), width: node.attr("width") } end def figure_title(node, f) - if node.title.nil? - style_warning(node, "Figure should have title", nil) - else + unless node.title.nil? f.name { |name| name << node.title } end end def image(node) @@ -161,10 +148,9 @@ attrs = { align: node.attr("align"), id: Utils::anchor_or_uuid(node) } noko do |xml| xml.p **attr_code(attrs) do |xml_t| xml_t << node.content - style(node, Utils::flatten_rawtext(node).join(" ")) end end.join("\n") end def quote_attrs(node)