Skip to content

Commit

Permalink
ignore ol type in asciidoctor parse: metanorma/metanorma-bipm#68
Browse files Browse the repository at this point in the history
  • Loading branch information
opoudjis committed Nov 18, 2020
1 parent d59e55f commit ea8bce4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
5 changes: 5 additions & 0 deletions lib/asciidoctor/iso/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ def init(node)
@amd = %w(amendment technical-corrigendum).include? doctype(node)
end

def ol_attrs(node)
attr_code(keep_attrs(node).
merge(id: ::Asciidoctor::Standoc::Utils::anchor_or_uuid(node)))
end

def outputs(node, ret)
File.open(@filename + ".xml", "w:UTF-8") { |f| f.write(ret) }
presentation_xml_converter(node).convert(@filename + ".xml")
Expand Down
2 changes: 1 addition & 1 deletion spec/asciidoctor-iso/blocks_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
#{BLANK_HDR}
<sections>
<admonition id="_" type="safety precautions"><name>Safety Precautions</name><p id="_">While werewolves are hardy community members, keep in mind the following dietary concerns:</p>
<ol id="_" type="arabic">
<ol id="_">
<li>
<p id="_">They are allergic to cinnamon.</p>
</li>
Expand Down
12 changes: 6 additions & 6 deletions spec/asciidoctor-iso/lists_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</li>
<li>
<p id="_">List 3</p>
<ol id="_" type="arabic">
<ol id="_">
<li>
<p id="_">List A</p>
</li>
Expand Down Expand Up @@ -107,13 +107,13 @@
<li><p id="_">Second</p><p id="_">entry1</p>
<p id="_">entry2</p></li>
</ul>
<ol id="id1" type="alphabet">
<ol id="id1">
<li>
<p id="_">First</p>
</li>
<li>
<p id="_">Second</p>
<ol id="_" type="alphabet_upper">
<ol id="_">
<li>
<p id="_">Third</p>
</li>
Expand All @@ -129,19 +129,19 @@
<p id="_">Sixth</p>
</li>
</ol>
<ol id="_" type="roman">
<ol id="_">
<li>
<p id="_">A</p>
</li>
<li>
<p id="_">B</p>
<ol id="_" type="roman_upper">
<ol id="_">
<li>
<p id="_">C</p>
</li>
<li>
<p id="_">D</p>
<ol id="_" type="arabic">
<ol id="_">
<li>
<p id="_">E</p>
</li>
Expand Down

0 comments on commit ea8bce4

Please sign in to comment.