Skip to content

Commit

Permalink
Merge pull request #84 from metanorma/fix/refactor-xrefs-oct24
Browse files Browse the repository at this point in the history
Fix/refactor xrefs oct24
  • Loading branch information
opoudjis authored Nov 5, 2024
2 parents 116a022 + ff9cc75 commit 259f835
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
2 changes: 2 additions & 0 deletions Gemfile.devel
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
gem "metanorma-standoc", git: "https://github.com/metanorma/metanorma-standoc", branch: "main"
gem "isodoc", git: "https://github.com/metanorma/isodoc", branch: "fix/presxml-oct24"
3 changes: 1 addition & 2 deletions lib/isodoc/generic/base_convert.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ def term_cleanup(docxml)
docxml.xpath("//p[@class = 'Terms']").each do |d|
h2 = d.at("./preceding-sibling::*[@class = 'TermNum'][1]")
d["id"] = h2["id"]
d.children.first.previous =
"<strong>#{to_xml(h2.remove.children)}</strong>&#xa0;"
d.add_first_child "<strong>#{to_xml(h2.remove.children)}</strong>&#xa0;"
end
docxml
end
Expand Down
2 changes: 1 addition & 1 deletion lib/isodoc/generic/init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def metadata_init(lang, script, locale, i18n)
end

def xref_init(lang, script, _klass, i18n, options)
html = HtmlConvert.new(language: lang, script: script)
html = PresentationXMLConvert.new(language: lang, script: script)
@xrefs = Xref.new(lang, script, html, i18n, options)
end

Expand Down
16 changes: 12 additions & 4 deletions spec/isodoc/html_convert_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@
it "processes pre" do
input = <<~"INPUT"
<generic-standard xmlns="#{Metanorma::Generic::DOCUMENT_NAMESPACE}">
<preface><foreword displayorder="1">
<preface><foreword displayorder="1"><title>Foreword</title>
<pre>ABC</pre>
</foreword></preface>
</generic-standard>
Expand Down Expand Up @@ -529,7 +529,7 @@
it "processes keyword" do
input = <<~"INPUT"
<generic-standard xmlns="#{Metanorma::Generic::DOCUMENT_NAMESPACE}">
<preface><foreword displayorder="1">
<preface><foreword displayorder="1"><title>Foreword</title>
<keyword>ABC</keyword>
</foreword></preface>
</generic-standard>
Expand Down Expand Up @@ -693,15 +693,23 @@
</term>
</terms>
<definitions id='K'>
<title>2.2.</title>
<title depth="2">
2.2.
<tab/>
Symbols
</title>
<dl>
<dt>Symbol</dt>
<dd>Definition</dd>
</dl>
</definitions>
</clause>
<definitions id='L' displayorder='6'>
<title>3.</title>
<title depth="1">
3.
<tab/>
Symbols
</title>
<dl>
<dt>Symbol</dt>
<dd>Definition</dd>
Expand Down

0 comments on commit 259f835

Please sign in to comment.