Skip to content

Commit f929deb

Browse files
committed
Presentation XML refactor, terms: #630
1 parent 12a5b3d commit f929deb

File tree

2 files changed

+31
-4
lines changed

2 files changed

+31
-4
lines changed

lib/isodoc/presentation_function/terms.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,13 @@ def termsource_modification(elem)
130130

131131
def termsource_add_modification_text(mod)
132132
mod or return
133-
mod.text.strip.empty? or mod.previous = " — "
133+
if mod.text.strip.empty?
134+
mod.remove
135+
return
136+
end
137+
mod.previous = " — "
134138
mod.elements.size == 1 and mod.children = to_xml(mod.elements[0].children)
135-
mod.text.strip.empty? or mod.replace(semx_fmt_dup(mod))
139+
mod.replace(semx_fmt_dup(mod))
136140
end
137141

138142
def termsource_status(status)

spec/isodoc/terms_spec.rb

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,14 @@
136136
<p id='_'>with adjustments</p>
137137
</modification>
138138
</termsource>
139+
<termsource status='adapted'>
140+
<origin citeas=''>
141+
<termref base='IEV' target='xyz'>t1</termref>
142+
</origin>
143+
<modification>
144+
<p id='_'/>
145+
</modification>
146+
</termsource>
139147
</term>
140148
<term id="paddy"><preferred><expression><name>paddy</name></expression></preferred>
141149
<admitted><letter-symbol><name>paddy rice</name></letter-symbol>
@@ -333,6 +341,14 @@
333341
<p original-id="_">with adjustments</p>
334342
</modification>
335343
</termsource>
344+
<termsource status="adapted" id="_">
345+
<origin citeas="">
346+
<termref base="IEV" target="xyz">t1</termref>
347+
</origin>
348+
<modification>
349+
<p original-id="_"/>
350+
</modification>
351+
</termsource>
336352
<fmt-termsource status="identical">
337353
[SOURCE:
338354
<semx element="termsource" source="_">
@@ -347,6 +363,13 @@
347363
<termref base="IEV" target="xyz"/>
348364
</origin>
349365
, modified — <semx element="modification" source="_">with adjustments</semx>
366+
</semx>
367+
;
368+
<semx element="termsource" source="_">
369+
<origin citeas="">
370+
<termref base="IEV" target="xyz">t1</termref>
371+
</origin>
372+
, adapted
350373
</semx>
351374
]
352375
</fmt-termsource>
@@ -568,7 +591,7 @@
568591
</ul>
569592
</div>
570593
</div>
571-
<p>[SOURCE: t1 — comment; Termbase IEV, term ID xyz, modified — with adjustments]</p>
594+
<p>[SOURCE: t1 — comment; Termbase IEV, term ID xyz, modified — with adjustments; t1, adapted]</p>
572595
<p class="TermNum" id="paddy">1.2.</p>
573596
<p class="Terms" style="text-align:left;">
574597
<b>paddy</b>
@@ -648,7 +671,7 @@
648671
</ul>
649672
</div>
650673
</div>
651-
<p>[SOURCE: t1 — comment; Termbase IEV, term ID xyz, modified — with adjustments]</p>
674+
<p>[SOURCE: t1 — comment; Termbase IEV, term ID xyz, modified — with adjustments; t1, adapted]</p>
652675
<p class="TermNum" id="paddy">1.2.</p>
653676
<p class="Terms" style="text-align:left;">
654677
<b>paddy</b>

0 commit comments

Comments
 (0)