diff --git a/lib/metanorma/standoc/cleanup_boilerplate.rb b/lib/metanorma/standoc/cleanup_boilerplate.rb index f20b933f..678af8a0 100644 --- a/lib/metanorma/standoc/cleanup_boilerplate.rb +++ b/lib/metanorma/standoc/cleanup_boilerplate.rb @@ -12,7 +12,7 @@ def norm_ref_preface(ref) %w(references bibitem).include? e.name end pref = refs.empty? ? @i18n.norm_empty_pref : @i18n.norm_with_refs_pref - ins.next = "

#{pref}

" + ins.next = boilerplate_snippet_convert(pref) end def norm_ref_process_boilerplate_note(ref) diff --git a/lib/metanorma/standoc/init.rb b/lib/metanorma/standoc/init.rb index d3d008da..5f115ee0 100644 --- a/lib/metanorma/standoc/init.rb +++ b/lib/metanorma/standoc/init.rb @@ -103,6 +103,7 @@ def init_i18n(node) def init_biblio(node) @no_isobib_cache = node.attr("no-isobib-cache") @no_isobib = node.attr("no-isobib") + @flush_caches = node.attr("flush-caches") init_bib_log @bibdb = nil init_bib_caches(node) diff --git a/lib/metanorma/standoc/ref_queue.rb b/lib/metanorma/standoc/ref_queue.rb index 7fe38b9a..7e7b1e15 100644 --- a/lib/metanorma/standoc/ref_queue.rb +++ b/lib/metanorma/standoc/ref_queue.rb @@ -228,7 +228,7 @@ def init_iev_caches(node) @iev_globalname = global_ievcache_name @iev_localname = local_ievcache_name(node.attr("local-cache") || node.attr("local-cache-only")) - if node.attr("flush-caches") + if @flush_caches FileUtils.rm_f @iev_globalname unless @iev_globalname.nil? FileUtils.rm_f @iev_localname unless @iev_localname.nil? end diff --git a/lib/metanorma/standoc/utils.rb b/lib/metanorma/standoc/utils.rb index df518fcd..e069b1d4 100644 --- a/lib/metanorma/standoc/utils.rb +++ b/lib/metanorma/standoc/utils.rb @@ -100,8 +100,9 @@ def xml_encode(text) # wrapped in def adoc2xml(text, flavour) Nokogiri::XML(text).root and return text + f = @flush_caches ? ":flush-caches:\n" : "" c = Asciidoctor.convert("= X\nA\n:semantic-metadata-headless: true\n" \ - ":novalid:\n\n#{text}\n", + ":no-isobib:\n#{f}:novalid:\n\n#{text}\n", backend: flavour, header_footer: true) Nokogiri::XML(c).at("//xmlns:sections") end diff --git a/spec/metanorma/isobib_cache_spec.rb b/spec/metanorma/isobib_cache_spec.rb index e6484977..308eac25 100644 --- a/spec/metanorma/isobib_cache_spec.rb +++ b/spec/metanorma/isobib_cache_spec.rb @@ -364,7 +364,7 @@ FileUtils.mv iev_file, iev_file1 if File.exist? iev_file File.write("#{Dir.home}/.relaton/cache", "XXX") - FileUtils.rm_rf File.expand_path("~/.iev/cache") + FileUtils.rm_rf File.expand_path("#{Dir.home}/.iev/cache") # mock_isobib_get_123 VCR.use_cassette("isobib_get_123_2001_and_iev",