kramdown-rfc2629 1.6.42 → 1.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/kramdown-rfc-extract-sourcecode +6 -2
- data/kramdown-rfc2629.gemspec +1 -1
- data/lib/kramdown-rfc2629.rb +14 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd5a2c0f3273c06c40f191cba73edff87064b7b07ff90eb28dbf50ff5128f476
|
4
|
+
data.tar.gz: 9a0a8949db295d24fc6cb7374b6438d3113e9ee84f465d3de4918d18ef1fac52
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 735f79f81ac9cb0e19fd06362a79dffe6b5e73e06d658c11b0e62439c8c9b66b40f19252c756a3d5fc592b709d70342ed5ec4c290260d7fd0b9ce080e76c2e67
|
7
|
+
data.tar.gz: bf6e459bd077b13b87baee248e4a76f0287833fcbb49d00f009ce5871cc1133742a67c5bf8f1c3d9cdaf27387235e6e464c4043afb863436726f2a49d71a529b
|
@@ -8,7 +8,8 @@ require_relative '../lib/kramdown-rfc/rexml-all-text.rb'
|
|
8
8
|
|
9
9
|
def clean(s)
|
10
10
|
s.gsub!(/\//, ":")
|
11
|
-
s.gsub!(
|
11
|
+
s.gsub!(/\A([-.]+)/) {"_" * $1.size }
|
12
|
+
s.gsub!(/[^-.:\w]/, "_")
|
12
13
|
s
|
13
14
|
end
|
14
15
|
|
@@ -53,7 +54,10 @@ REXML::XPath.each(d.root, "//sourcecode|//artwork") do |x|
|
|
53
54
|
if ty = x[:type]
|
54
55
|
ty = clean(ty)
|
55
56
|
name = x[:name]
|
56
|
-
|
57
|
+
if !name || name.empty?
|
58
|
+
name = gensym.succ!.dup
|
59
|
+
name = "#{name}.#{ty}" unless ty.empty?
|
60
|
+
end
|
57
61
|
name = clean(name)
|
58
62
|
if taken[ty][name]
|
59
63
|
unless warned[ty][name]
|
data/kramdown-rfc2629.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
spec = Gem::Specification.new do |s|
|
2
2
|
s.name = 'kramdown-rfc2629'
|
3
|
-
s.version = '1.
|
3
|
+
s.version = '1.7.1'
|
4
4
|
s.summary = "Kramdown extension for generating RFCXML (RFC 799x)."
|
5
5
|
s.description = %{An RFCXML (RFC 799x) generating backend for Thomas Leitner's
|
6
6
|
"kramdown" markdown parser. Mostly useful for RFC writers.}
|
data/lib/kramdown-rfc2629.rb
CHANGED
@@ -42,8 +42,8 @@ module Kramdown
|
|
42
42
|
sorted_abbrevs = @root.options[:abbrev_defs].keys.sort {|a, b| b.length <=> a.length }
|
43
43
|
regexps = [Regexp.union(*sorted_abbrevs.map {|k|
|
44
44
|
/#{Regexp.escape(k).gsub(/\\\s/, "[\\s\\p{Z}]+").force_encoding(Encoding::UTF_8)}/})]
|
45
|
-
# warn regexps.inspect
|
46
45
|
regexps << /(?=(?:\W|^)#{regexps.first}(?!\w))/ # regexp should only match on word boundaries
|
46
|
+
# warn regexps.inspect
|
47
47
|
end
|
48
48
|
super(el, regexps)
|
49
49
|
end
|
@@ -1498,7 +1498,9 @@ COLORS
|
|
1498
1498
|
|
1499
1499
|
hacked_value = value
|
1500
1500
|
|
1501
|
+
nobr = false
|
1501
1502
|
if title && title =~ /\A<nobr>(\z|\s)/
|
1503
|
+
nobr = true
|
1502
1504
|
_nobr, title = title.split(' ', 2)
|
1503
1505
|
hacked_value = nobr_hack(value)
|
1504
1506
|
if title.nil? || title.empty?
|
@@ -1518,11 +1520,19 @@ COLORS
|
|
1518
1520
|
end
|
1519
1521
|
|
1520
1522
|
if item = title
|
1521
|
-
|
1522
|
-
|
1523
|
+
pairs = title.split(Parser::RFC2629Kramdown::IREF_START).each_slice(2).to_a
|
1524
|
+
replacement = pairs.map {|x,| s = x.strip; s unless s.empty?}.compact.join(" ")
|
1525
|
+
irefs = pairs.map {|_,x| x && [x]}.compact
|
1526
|
+
warn "@@@ ABBREV MISMATCH #{irefs}" if title.scan(Parser::RFC2629Kramdown::IREF_START) != irefs
|
1527
|
+
if irefs.empty?
|
1523
1528
|
subitem = value
|
1524
1529
|
else
|
1525
|
-
iref =
|
1530
|
+
iref = irefs.map{|a,| iref_attr(a)}.join('')
|
1531
|
+
end
|
1532
|
+
unless replacement.empty?
|
1533
|
+
replacement = nobr_hack(replacement) if nobr # XXX this can break XML
|
1534
|
+
replacement = ::Kramdown::Converter::Rfc2629::process_markdown(replacement)
|
1535
|
+
hacked_value = replacement
|
1526
1536
|
end
|
1527
1537
|
else
|
1528
1538
|
item = value
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kramdown-rfc2629
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carsten Bormann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-09-
|
11
|
+
date: 2023-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: kramdown
|