lib/isodoc/function/cleanup.rb in isodoc-1.0.26 vs lib/isodoc/function/cleanup.rb in isodoc-1.0.27
- old
+ new
@@ -1,12 +1,20 @@
module IsoDoc::Function
module Cleanup
def textcleanup(docxml)
+ docxml = passthrough_cleanup(docxml)
docxml.
gsub(/\[TERMREF\]\s*/, l10n("[#{@source_lbl}: ")).
gsub(/\s*\[MODIFICATION\]\s*\[\/TERMREF\]/, l10n(", #{@modified_lbl} [/TERMREF]")).
gsub(/\s*\[\/TERMREF\]\s*/, l10n("]")).
gsub(/\s*\[MODIFICATION\]/, l10n(", #{@modified_lbl} — "))
+ end
+
+ def passthrough_cleanup(docxml)
+ docxml = docxml.split(%r{(<passthrough>|</passthrough>)}).each_slice(4).map do |a|
+ a.size > 2 and a[2] = HTMLEntities.new.decode(a[2])
+ [a[0], a[2]]
+ end.join
end
def cleanup(docxml)
comment_cleanup(docxml)
footnote_cleanup(docxml)