Skip to content
Permalink
Browse files

1.2.12: use ?anchor= feature for bibxml...

... so reference label change works for stand_alone: false
(due to server limitations, for IANA and DOI only).
Caution:
Might require occasional cache cleaning due to a remaining issue in xml2rfc.
  • Loading branch information...
cabo committed May 17, 2019
1 parent daae4a6 commit 57ad6a85e32feff6bc69b2243085f70835bc42e0
Showing with 6 additions and 2 deletions.
  1. +1 −1 kramdown-rfc2629.gemspec
  2. +5 −1 lib/kramdown-rfc2629.rb
@@ -1,6 +1,6 @@
spec = Gem::Specification.new do |s|
s.name = 'kramdown-rfc2629'
s.version = '1.2.11'
s.version = '1.2.12'
s.summary = "Kramdown extension for generating RFC 7749 XML."
s.description = %{An RFC7749 (XML2RFC) generating backend for Thomas Leitner's
"kramdown" markdown parser. Mostly useful for RFC writers.}
@@ -519,10 +519,14 @@ def convert_img(el, indent, opts) # misuse the tag!
to_insert = ""
src.scan(/(W3C|3GPP|[A-Z-]+)[.]?([A-Za-z_0-9.\/\+-]+)/) do |t, n|
fn = "reference.#{t}.#{n}.xml"
sub, ttl = XML_RESOURCE_ORG_MAP[t]
sub, ttl, can_anchor = XML_RESOURCE_ORG_MAP[t]
ttl ||= KRAMDOWN_REFCACHETTL # everything but RFCs might change a lot
puts "Huh: ${fn}" unless sub
url = "#{XML_RESOURCE_ORG_PREFIX}/#{sub}/#{fn}"
if can_anchor # create anchor server-side for stand_alone: false
url << "?anchor=#{anchor}"
fn[/.xml$/] = "--anchor=#{anchor}.xml"
end
to_insert = get_and_cache_resource(url, fn.gsub('/', '_'), ttl)
to_insert.scrub! rescue nil # only do this for Ruby >= 2.1
# this may be a bit controversial: Don't break the build if reference is broken

0 comments on commit 57ad6a8

Please sign in to comment.
You can’t perform that action at this time.