kramdown-rfc2629 1.0.18 → 1.0.19

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0b7cb03b26cc3280334da9e30264652850c904f4
4
- data.tar.gz: 593ed4923195d254b3c27ace03e09a9e24a22f0e
3
+ metadata.gz: 5d68b8928a16df28ada77fdb50e2450845c458c0
4
+ data.tar.gz: 747a779389488dd339319a4b6004ab0f2fa9f562
5
5
  SHA512:
6
- metadata.gz: 6403e62c32307c3e66b93d7c130f6efe5b7ccc3587da9ba7f075a206820b476699ecf0dd1e83ae4bb815dbea94b7ada550a8f838ef6c395c08170df36a113352
7
- data.tar.gz: 9698f63a545f44d08ddcd97aac1baf282b1171da5627e840a1be8a833ed8147e04f47b67d727feb1832786085670e9bf5e384ab253e89d9ea9f230cac7aa7c16
6
+ metadata.gz: c3f7937f66db0c675f0c246493d0f31934f7edcf5606472b085e7dca6e385bdad8e1278c4673f06ddda430ee4159d8877a1b96696b81950aa52061b4a2f59975
7
+ data.tar.gz: 1b0c052acb904b08ad997d2951a5f4e0fc06b7f3404dfffd5ba235348918160da44ca0f9050e5d9fb01d92514817b165f90e4750bfc22ffd81a45a860d167b76
data/README.md CHANGED
@@ -98,6 +98,21 @@ or
98
98
  country: Finland
99
99
  phone: "+358407796297"
100
100
  email: zach@sensinode.com
101
+ -
102
+ role: editor
103
+ ins: P. Thubert
104
+ name: Pascal Thubert
105
+ org: Cisco Systems
106
+ abbrev: Cisco
107
+ street:
108
+ - Village d'Entreprises Green Side
109
+ - 400, Avenue de Roumanille
110
+ - Batiment T3
111
+ city: Biot - Sophia Antipolis
112
+ code: '06410'
113
+ country: FRANCE
114
+ phone: "+33 4 97 23 26 34"
115
+ email: pthubert@cisco.com
101
116
 
102
117
  (the hash keys are the XML GIs from RFC 2629, with a flattened
103
118
  structure. As RFC 2629 requires giving both the name and
@@ -105,6 +120,10 @@ surname/initials, we use `ins` as an abbreviation for
105
120
  "initials/surname". Yes, the toolchain is Unicode-capable, even if
106
121
  the final RFC output is still in ASCII.)
107
122
 
123
+ Note that the YAML header needs to be syntactically valid YAML.
124
+ Where there is a potential for triggering some further YAML feature, a
125
+ string should be put in quotes (like the "+358407796297" above, which
126
+ might otherwise be interpreted as a number, losing the + sign).
108
127
 
109
128
  ## References
110
129
 
@@ -133,6 +152,7 @@ spell it out like this:
133
152
  RFC1925:
134
153
  WEI:
135
154
  title: "6LoWPAN: the Wireless Embedded Internet"
155
+ # see the quotes above? Needed because of the embedded colon.
136
156
  author:
137
157
  -
138
158
  ins: Z. Shelby
@@ -149,6 +169,7 @@ spell it out like this:
149
169
  Information Technology — ASN.1 encoding rules:
150
170
  Specification of Basic Encoding Rules (BER), Canonical Encoding
151
171
  Rules (CER) and Distinguished Encoding Rules (DER)
172
+ # YAML's ">" syntax used above is a good way to write longer titles
152
173
  author:
153
174
  org: International Telecommunications Union
154
175
  date: 1994
@@ -210,9 +231,8 @@ verbose (this syntax is now also supported in kramdown-rfc2629).
210
231
 
211
232
  # License
212
233
 
213
- With kramdown version 1.0, kramdown itself now is MIT licensed, so it
214
- is finally possible to license kramdown-rfc2629 under the same
215
- license.
234
+ Since kramdown version 1.0, kramdown itself is MIT licensed, which
235
+ made it possible to license kramdown-rfc2629 under the same license.
216
236
 
217
237
  [kramdown]: http://kramdown.rubyforge.org/
218
238
  [stupid]: http://tools.ietf.org/id/draft-hartke-xmpp-stupid-00
data/bin/kramdown-rfc2629 CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env ruby1.9
1
+ #!/usr/bin/env ruby2.1
2
2
  # -*- coding: utf-8 -*-
3
3
  require 'kramdown-rfc2629'
4
4
  require 'yaml'
@@ -19,7 +19,9 @@ def xml_from_sections(input)
19
19
  # resulting in an array; each section is [section-label, nomarkdown-flag, section-text]
20
20
 
21
21
  # the first section is a YAML with front matter parameters (don't put a label here)
22
- ps = ParameterSet.new(YAML.load(sections.shift[2]))
22
+ # We put back the "---" plus gratuitous blank lines to hack the line number in errors
23
+ yaml_in = input[/---\s*/] << sections.shift[2]
24
+ ps = ParameterSet.new(YAML.load(yaml_in))
23
25
  coding_override = (ps.has(:coding) =~ /ascii/i) ? :symbolic : :as_char
24
26
 
25
27
  # all the other sections are put in a Hash, possibly concatenated from parts there
@@ -1,6 +1,6 @@
1
1
  spec = Gem::Specification.new do |s|
2
2
  s.name = 'kramdown-rfc2629'
3
- s.version = '1.0.18'
3
+ s.version = '1.0.19'
4
4
  s.summary = "Kramdown extension for generating RFC 2629 XML."
5
5
  s.description = %{An RFC2629 (XML2RFC) generating backend for Thomas Leitner's
6
6
  "kramdown" markdown parser. Mostly useful for RFC writers.}
@@ -303,9 +303,13 @@ module Kramdown
303
303
  if alignment = opts[:table_alignment]
304
304
  alignment = alignment.shift
305
305
  if cols = opts[:table_cols].shift
306
- md = cols.match(/(\d*)(.*)/)
307
- widthopt = "width='#{md[1]}' " if md[1].to_i != 0
308
- alignment = COLS_ALIGN[md[2]] || :left
306
+ md = cols.match(/(\d*(|em|[%*]))([lrc])/)
307
+ if md[1].to_i != 0
308
+ widthval = md[1]
309
+ widthval << "em" if md[2].empty?
310
+ widthopt = "width='#{widthval}' "
311
+ end
312
+ alignment = COLS_ALIGN[md[3]] || :left
309
313
  end
310
314
  end
311
315
  res = inner(el, indent, opts)
@@ -488,7 +492,7 @@ module Kramdown
488
492
  end
489
493
 
490
494
  def convert_abbreviation(el, indent, opts) # XXX: This is wrong
491
- title = @doc.parse_infos[:abbrev_defs][el.value]
495
+ title = @root.options[:abbrev_defs][el.value]
492
496
  title = nil if title.empty?
493
497
  "<abbr#{title ? " title=\"#{title}\"" : ''}>#{el.value}</abbr>"
494
498
  end
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.0.18
4
+ version: 1.0.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carsten Bormann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-21 00:00:00.000000000 Z
11
+ date: 2014-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: kramdown