Skip to content

Commit

Permalink
consistent insertion of 'Abstract:' heading in Word: #379
Browse files Browse the repository at this point in the history
  • Loading branch information
opoudjis committed Jun 19, 2024
1 parent 616d57a commit bf8bbea
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions lib/isodoc/ieee/word_authority.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "<p>&#xa0;</p>"
i == 4 and
div.xpath(".//p[br]").each do |p|
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion spec/isodoc/postproc_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<div class='main-section'>
<hr/>
<div id='abstract-destination'>
<p class='IEEEStdsAbstractBody' style="font-family: 'Arial', sans-serif;">Abstract text</p>
<p class='IEEEStdsAbstractBody' style="font-family: 'Arial', sans-serif;"><span class="IEEEStdsAbstractHeader"><span lang="EN-US">Abstract:</span></span> Abstract text</p>
<ul>
<li>
<p style="font-family: 'Arial', sans-serif;" class='IEEEStdsAbstractBody'>X</p>
Expand Down
2 changes: 1 addition & 1 deletion spec/isodoc/word_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
output = <<~OUTPUT
<div>
<a name='abstract-destination' id='abstract-destination'/>
<div class='IEEEStdsWarning'>This introduction is not part of P1000/D0.3.4, Draft Standard for Empty </div>
<div class='IEEEStdsWarning'><span class="IEEEStdsAbstractHeader"><span lang="EN-US" xml:lang="EN-US">Abstract:</span></span> This introduction is not part of P1000/D0.3.4, Draft Standard for Empty </div>
<p class='IEEEStdsAbstractBody' style="font-family: 'Arial', sans-serif;">Text</p>
<div class="ul_wrap">
<p style="mso-list:l11 level1 lfo1-1;text-indent:-0.79cm; margin-left:1.1600000000000001cm;font-family: 'Arial', sans-serif;" class="IEEEStdsUnorderedListCxSpFirst">List</p>
Expand Down

0 comments on commit bf8bbea

Please sign in to comment.