From bf8bbea5a1fa7da437365e9de9311bbb89cf64b0 Mon Sep 17 00:00:00 2001 From: Nick Nicholas Date: Wed, 19 Jun 2024 22:17:08 +1000 Subject: [PATCH] consistent insertion of 'Abstract:' heading in Word: https://github.com/metanorma/metanorma-ieee/issues/379 --- lib/isodoc/ieee/word_authority.rb | 5 +++-- spec/isodoc/postproc_spec.rb | 2 +- spec/isodoc/word_spec.rb | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/isodoc/ieee/word_authority.rb b/lib/isodoc/ieee/word_authority.rb index e8f7ba1..cd38182 100644 --- a/lib/isodoc/ieee/word_authority.rb +++ b/lib/isodoc/ieee/word_authority.rb @@ -138,8 +138,8 @@ def feedback_table1(trow) end def feedback_style(docxml) - docxml.at("//div[@class = 'boilerplate-feedback']")&.xpath("./div") - &.each_with_index do |div, i| + f = docxml.at("//div[@class = 'boilerplate-feedback']") or return + f.xpath("./div").each_with_index do |div, i| i.zero? or div.elements.first.previous = "

 

" i == 4 and div.xpath(".//p[br]").each do |p| @@ -182,6 +182,7 @@ def abstract_cleanup(docxml) if f = docxml.at("//div[@class = 'abstract']") f.previous_element.remove abstract_cleanup1(f, dest) + abstract_header(dest) f.remove elsif f = docxml.at("//div[@type = 'scope']") abstract_cleanup1(f, dest) diff --git a/spec/isodoc/postproc_spec.rb b/spec/isodoc/postproc_spec.rb index 130cd75..f0ba0ba 100644 --- a/spec/isodoc/postproc_spec.rb +++ b/spec/isodoc/postproc_spec.rb @@ -70,7 +70,7 @@

-

Abstract text

+

Abstract: Abstract text