kramdown-rfc2629 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4f71be9fe27c120f6767476076442f9662d1b870
4
- data.tar.gz: c3ea9106402462cb6caf20e9339276feda33988c
3
+ metadata.gz: 0514d45c33a7763acd79527b7473350f5387a62b
4
+ data.tar.gz: 6ecf14961ac99318a6035a6cc75d78a79ad556cd
5
5
  SHA512:
6
- metadata.gz: 6ddafd91524cdf6c788844b6c6468bb14787aef0381b17926f4112cfe6da8376c82a4568c0e79a2249576d0f025cf2686e040ece2ef12e0eaa3d945d4b1b29e3
7
- data.tar.gz: 311f5257a6f5a29b4a4e5e100045ab7d557befe8f4ef064d6c4032d0d06c9a5e3656e12aaa2a6b2d42c1f38aa8ab84449daf716d025ec8e69e8b27afc60245bb
6
+ metadata.gz: 99746722e09abf6dee605f5a487eaee4b58e0ca6869e388a517980d6e02157e36828241aa4d14f88e58d3c68a1b943edd31035df1991300dd6b2c2ad137de737
7
+ data.tar.gz: 4789ee4018db489c9aa34142a332371849aff9d6e18b5e3e12d28911912a3896bf4d71682bd2b66cfbb57863fe22820bcd7dbdfdbabd28d6bbbc12f73ec3afd9
@@ -1,6 +1,6 @@
1
1
  spec = Gem::Specification.new do |s|
2
2
  s.name = 'kramdown-rfc2629'
3
- s.version = '1.0.4'
3
+ s.version = '1.0.5'
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.}
@@ -281,10 +281,12 @@ module Kramdown
281
281
  alias :convert_html_doctype :convert_xml_comment
282
282
 
283
283
  ALIGNMENTS = { default: :left, left: :left, right: :right, center: :center}
284
+ COLS_ALIGN = { "l" => :left, "c" => :center, "r" => :right}
284
285
 
285
286
  def convert_table(el, indent, opts) # This only works for tables with headers
286
287
  alignment = el.options[:alignment].map { |al| ALIGNMENTS[al]}
287
- "#{' '*indent}<texttable#{el_html_attributes(el)}>\n#{inner(el, indent, opts.merge(table_alignment: alignment))}#{' '*indent}</texttable>\n"
288
+ cols = (el.attr.delete("cols") || "").split(' ')
289
+ "#{' '*indent}<texttable#{el_html_attributes(el)}>\n#{inner(el, indent, opts.merge(table_alignment: alignment, table_cols: cols))}#{' '*indent}</texttable>\n"
288
290
  end
289
291
 
290
292
  def convert_thead(el, indent, opts)
@@ -297,10 +299,15 @@ module Kramdown
297
299
  def convert_td(el, indent, opts)
298
300
  if alignment = opts[:table_alignment]
299
301
  alignment = alignment.shift
302
+ if cols = opts[:table_cols].shift
303
+ md = cols.match(/(\d*)(.*)/)
304
+ widthopt = "width='#{md[1]}' " if md[1].to_i != 0
305
+ alignment = COLS_ALIGN[md[2]] || :left
306
+ end
300
307
  end
301
308
  res = inner(el, indent, opts)
302
309
  if alignment
303
- "#{' '*indent}<ttcol align='#{alignment}'#{el_html_attributes(el)}>#{res.empty? ? "&#160;" : res}</ttcol>\n"
310
+ "#{' '*indent}<ttcol #{widthopt}align='#{alignment}'#{el_html_attributes(el)}>#{res.empty? ? "&#160;" : res}</ttcol>\n"
304
311
  else
305
312
  "#{' '*indent}<c#{el_html_attributes(el)}>#{res.empty? ? "&#160;" : res}</c>\n"
306
313
  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.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carsten Bormann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-26 00:00:00.000000000 Z
11
+ date: 2013-05-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: kramdown