Skip to content

Commit

Permalink
1.2.12: use ?anchor= feature for bibxml...
Browse files Browse the repository at this point in the history
... 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 57ad6a8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion kramdown-rfc2629.gemspec
@@ -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.}
Expand Down
6 changes: 5 additions & 1 deletion lib/kramdown-rfc2629.rb
Expand Up @@ -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
Expand Down

0 comments on commit 57ad6a8

Please sign in to comment.