lib/metanorma/standoc/ref_queue.rb in metanorma-standoc-2.6.1 vs lib/metanorma/standoc/ref_queue.rb in metanorma-standoc-2.6.2
- old
+ new
@@ -140,11 +140,16 @@
@log.add("Bibliography", nil, "Could not retrieve #{code}: " \
"no access to online site")
nil
end
+ def supply_ref_prefix(ret)
+ ret
+ end
+
def fetch_ref1(code, year, opts)
+ code = supply_ref_prefix(code)
if opts[:localfile]
@local_bibdb.get(code, opts[:localfile])
else @bibdb&.fetch(code, year, opts)
end
end
@@ -154,9 +159,10 @@
/^\(.+\)$/.match?(ref[:code]) ||
(@bibdb.nil? && !ref[:localfile])
end
def fetch_ref_async(ref, idx, res)
+ ref[:code] &&= supply_ref_prefix(ref[:code])
if unfetchable_ref_code?(ref)
res << [ref, idx, nil]
idx += 1
elsif ref[:localfile]
res << [ref, idx, @local_bibdb.get(ref[:code], ref[:localfile])]