kramdown 1.7.0 → 1.8.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of kramdown might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 28967ed8b0da11707a43ff1e7e92eb844d472fd0
4
- data.tar.gz: dcf6f6dcf3f06e7bbf0c6fe90f326e380466b29b
3
+ metadata.gz: 0fd1d5abb103643686848dd667d1e3106c4f5bcc
4
+ data.tar.gz: 6e14c9a736721e2bb5aab181d6c11f861f9edf83
5
5
  SHA512:
6
- metadata.gz: 4736e9a72ae7c194704ea5e7870e0bee43161794d2f71c071df0def49933578e02fabd72c4c02ba80b70f045fce748cb494c83a40ff915511bd7c8a39036a6d5
7
- data.tar.gz: 86304867c51dcaa09e446701d88d975cdfada7d998d6051bd2479defda8d8ef1c0d9c2f3b74f3fce0ee17832e8d6785574a694f39fe063e6347ceeb24c245cf4
6
+ metadata.gz: 5c6b26d0390aa2a2afdfad39cfcfadd782cc04c7e5c6d4ef00f5ccd66c78108b3271675adfd63c7182482024f6a817e104c7e4added160e895dd52d515a7d69f
7
+ data.tar.gz: bc3c786078e444d72d27985cd349b74e69b523d3419bd9bd78ac24ca0766a7a8275efaa52e99b425c45f4675b5963e2bdbaa408b5682fa6066c0e4a86491765f
data/CONTRIBUTERS CHANGED
@@ -1,6 +1,6 @@
1
1
  Count Name
2
2
  ======= ====
3
- 763 Thomas Leitner <t_leitner@gmx.at>
3
+ 772 Thomas Leitner <t_leitner@gmx.at>
4
4
  6 Gioele Barabucci <gioele@svario.it>
5
5
  4 Ted Pak <powerpak006@gmail.com>
6
6
  4 Arne Brasseur <arne@arnebrasseur.net>
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.7.0
1
+ 1.8.0
data/doc/index.page CHANGED
@@ -97,8 +97,8 @@ extensions that have been made popular by the [PHP Markdown Extra] package and [
97
97
  It is probably the fastest pure-Ruby Markdown converter available (September 2014), being about 3x
98
98
  faster than [Maruku] and about 4.5x faster than [BlueFeather].
99
99
 
100
- Version **1.7.0**{:itemprop="softwareVersion"} released on
101
- **2015-04-27**{:itemprop="datePublished"}, [more news](news.html)
100
+ Version **1.8.0**{:itemprop="softwareVersion"} released on
101
+ **2015-07-04**{:itemprop="datePublished"}, [more news](news.html)
102
102
  {: style="text-align: center; font-size: 80%"}
103
103
 
104
104
  </div>
@@ -26,17 +26,14 @@ See the platform specific installation notes for more information!
26
26
  ### Linux
27
27
 
28
28
  There are a variety of Linux distributions out there with different package management systems. So
29
- we will focus on instructions for Ubuntu 9.04 here (which should probably also work for any newer
29
+ we will focus on instructions for Ubuntu 15.04 here (which should probably also work for any newer
30
30
  Ubuntu version or any recent Debian based distribution).
31
31
 
32
32
  After running the following commands, kramdown is installed and ready to use:
33
33
 
34
- sudo aptitude install ruby rubygems
34
+ sudo apt-get install ruby
35
35
  sudo gem install kramdown
36
36
 
37
- > You will also need to add `export PATH=$PATH:/var/lib/gems/1.9/bin` to your `~/.bashrc` because
38
- > this is the binary path the executable files get installed to.
39
-
40
37
 
41
38
  ### Mac OS X
42
39
 
@@ -330,7 +330,7 @@ module Kramdown
330
330
  def convert_root(el, indent)
331
331
  result = inner(el, indent)
332
332
  if @footnote_location
333
- result.sub!(/#{@footnote_location}/, footnote_content)
333
+ result.sub!(/#{@footnote_location}/, footnote_content.gsub(/\\/, "\\\\\\\\"))
334
334
  else
335
335
  result << footnote_content
336
336
  end
@@ -341,7 +341,7 @@ module Kramdown
341
341
  else
342
342
  ''
343
343
  end
344
- result.sub!(/#{@toc_code.last}/, text)
344
+ result.sub!(/#{@toc_code.last}/, text.gsub(/\\/, "\\\\\\\\"))
345
345
  end
346
346
  result
347
347
  end
@@ -430,6 +430,7 @@ module Kramdown
430
430
  ol = Element.new(:ol)
431
431
  ol.attr['start'] = @footnote_start if @footnote_start != 1
432
432
  i = 0
433
+ backlink_text = escape_html(@options[:footnote_backlink], :text)
433
434
  while i < @footnotes.length
434
435
  name, data, _, repeat = *@footnotes[i]
435
436
  li = Element.new(:li, nil, {'id' => "fn:#{name}"})
@@ -443,9 +444,9 @@ module Kramdown
443
444
  insert_space = false
444
445
  end
445
446
 
446
- para.children << Element.new(:raw, FOOTNOTE_BACKLINK_FMT % [insert_space ? ' ' : '', name, "&#8617;"])
447
+ para.children << Element.new(:raw, FOOTNOTE_BACKLINK_FMT % [insert_space ? ' ' : '', name, backlink_text])
447
448
  (1..repeat).each do |index|
448
- para.children << Element.new(:raw, FOOTNOTE_BACKLINK_FMT % [" ", "#{name}:#{index}", "&#8617;<sup>#{index+1}</sup>"])
449
+ para.children << Element.new(:raw, FOOTNOTE_BACKLINK_FMT % [" ", "#{name}:#{index}", "#{backlink_text}<sup>#{index+1}</sup>"])
449
450
  end
450
451
 
451
452
  ol.children << Element.new(:raw, convert(li, 4))
@@ -237,7 +237,7 @@ module Kramdown
237
237
  @data[:packages] << 'minted'
238
238
  "#{latex_link_target(el)}#{highlighted_code}"
239
239
  else
240
- "{\\tt #{latex_link_target(el)}#{escape(el.value)}}"
240
+ "\\texttt{#{latex_link_target(el)}#{escape(el.value)}}"
241
241
  end
242
242
  end
243
243
 
@@ -580,6 +580,16 @@ EOF
580
580
  val
581
581
  end
582
582
 
583
+ define(:footnote_backlink, String, '&#8617;', <<EOF)
584
+ Defines the text that should be used for the footnote backlinks
585
+
586
+ The footnote backlink is just text, so any special HTML characters will
587
+ be escaped.
588
+
589
+ Default: '&8617;'
590
+ Used by: HTML converter
591
+ EOF
592
+
583
593
  end
584
594
 
585
595
  end
@@ -86,7 +86,6 @@ module Kramdown
86
86
  @tree.children << el
87
87
 
88
88
  if !closed && HTML_ELEMENTS_WITHOUT_BODY.include?(el.value)
89
- warning("The HTML tag '#{el.value}' on line #{line} cannot have any content - auto-closing it")
90
89
  closed = true
91
90
  end
92
91
  if name == 'script' || name == 'style'
@@ -11,7 +11,7 @@ module Kramdown
11
11
  module Parser
12
12
  class Kramdown
13
13
 
14
- BLANK_LINE = /(?:^\s*\n)+/
14
+ BLANK_LINE = /(?>^\s*\n)+/
15
15
 
16
16
  # Parse the blank line at the current postition.
17
17
  def parse_blank_line
@@ -140,9 +140,7 @@ module Kramdown
140
140
  :content_model => (do_parsing ? :span : :raw), :is_closed => !!@src[4])
141
141
  @tree.children << el
142
142
  stop_re = /<\/#{Regexp.escape(tag_name)}\s*>/i
143
- if !@src[4] && HTML_ELEMENTS_WITHOUT_BODY.include?(el.value)
144
- warning("The HTML tag '#{el.value}' on line #{line} cannot have any content - auto-closing it")
145
- elsif !@src[4]
143
+ if !@src[4] && !HTML_ELEMENTS_WITHOUT_BODY.include?(el.value)
146
144
  if parse_spans(el, stop_re, (do_parsing ? nil : [:span_html]))
147
145
  @src.scan(stop_re)
148
146
  else
@@ -123,7 +123,7 @@ module Kramdown
123
123
 
124
124
  SQ_RULES = [
125
125
  [/("|')(?=[_*]{1,2}\S)/, [:lquote1]],
126
- [/("|')(?=#{SQ_PUNCT}\B)/, [:rquote1]],
126
+ [/("|')(?=#{SQ_PUNCT}(?!\.\.)\B)/, [:rquote1]],
127
127
  # Special case for double sets of quotes, e.g.:
128
128
  # <p>He said, "'Quoted' words in a larger quote."</p>
129
129
  [/(\s?)"'(?=\w)/, [1, :ldquo, :lsquo]],
@@ -45,8 +45,10 @@ module Kramdown
45
45
 
46
46
  while !@src.eos?
47
47
  break if !@src.check(TABLE_LINE)
48
- if @src.scan(TABLE_SEP_LINE) && !rows.empty?
49
- if table.options[:alignment].empty? && !has_footer
48
+ if @src.scan(TABLE_SEP_LINE)
49
+ if rows.empty?
50
+ # nothing to do, ignoring multiple consecutive separator lines
51
+ elsif table.options[:alignment].empty? && !has_footer
50
52
  add_container.call(:thead, false)
51
53
  table.options[:alignment] = @src[1].scan(TABLE_HSEP_ALIGN).map do |left, right|
52
54
  (left.empty? && right.empty? && :default) || (right.empty? && :left) || (left.empty? && :right) || :center
@@ -10,6 +10,6 @@
10
10
  module Kramdown
11
11
 
12
12
  # The kramdown version.
13
- VERSION = '1.7.0'
13
+ VERSION = '1.8.0'
14
14
 
15
15
  end
data/man/man1/kramdown.1 CHANGED
@@ -181,6 +181,18 @@ Default: :as_char
181
181
  Used by: HTML converter, kramdown converter
182
182
 
183
183
 
184
+ .TP
185
+ .B \-\-footnote-backlink ARG
186
+
187
+ Defines the text that should be used for the footnote backlinks
188
+
189
+ The footnote backlink is just text, so any special HTML characters will
190
+ be escaped.
191
+
192
+ Default: '&8617;'
193
+ Used by: HTML converter
194
+
195
+
184
196
  .TP
185
197
  .B \-\-footnote-nr ARG
186
198
 
@@ -6,3 +6,7 @@
6
6
 
7
7
  <p>|no|table|here|
8
8
  paragraph</p>
9
+
10
+ <p>|-|-|
11
+ |-|-|</p>
12
+
@@ -7,3 +7,7 @@ No table body
7
7
 
8
8
  |no|table|here|
9
9
  paragraph
10
+
11
+ |-|-|
12
+ |-|-|
13
+
@@ -1,5 +1,5 @@
1
1
  <ul id="markdown-toc">
2
- <li><a href="#header-level-2" id="markdown-toc-header-level-2">Header level 2</a> <ul>
2
+ <li><a href="#header--level-2" id="markdown-toc-header--level-2">Header \` level 2</a> <ul>
3
3
  <li><a href="#header-level-3" id="markdown-toc-header-level-3">Header level 3</a></li>
4
4
  </ul>
5
5
  </li>
@@ -11,7 +11,7 @@
11
11
 
12
12
  <h1 id="header-level-1">Header level 1</h1>
13
13
 
14
- <h2 id="header-level-2">Header level 2</h2>
14
+ <h2 id="header--level-2">Header \` level 2</h2>
15
15
 
16
16
  <h3 id="header-level-3">Header level 3</h3>
17
17
 
@@ -3,7 +3,7 @@
3
3
 
4
4
  # Header level 1
5
5
 
6
- ## Header level 2
6
+ ## Header \\\` level 2
7
7
 
8
8
  ### Header level 3
9
9
 
@@ -0,0 +1,9 @@
1
+ <p>Some footnote here<sup id="fnref:fn"><a href="#fn:fn" class="footnote">1</a></sup></p>
2
+
3
+ <div class="footnotes">
4
+ <ol>
5
+ <li id="fn:fn">
6
+ <p>Some text here <a href="#fnref:fn" class="reversefootnote">text &8617; &lt;img /&gt;</a></p>
7
+ </li>
8
+ </ol>
9
+ </div>
@@ -0,0 +1 @@
1
+ :footnote_backlink: 'text &8617; <img />'
@@ -0,0 +1,3 @@
1
+ Some footnote here[^fn]
2
+
3
+ [^fn]: Some text here
@@ -1,7 +1,7 @@
1
1
  <div class="footnotes">
2
2
  <ol>
3
3
  <li id="fn:1">
4
- <p>Footnote text <a href="#fnref:1" class="reversefootnote">&#8617;</a></p>
4
+ <p>Footnote \` text <a href="#fnref:1" class="reversefootnote">&#8617;</a></p>
5
5
  </li>
6
6
  </ol>
7
7
  </div>
@@ -3,6 +3,6 @@
3
3
 
4
4
  Some para with a[^1] footnote.
5
5
 
6
- [^1]: Footnote text
6
+ [^1]: Footnote \\\` text
7
7
 
8
8
  And another para.
@@ -0,0 +1,14 @@
1
+ <h1>Something</h1>
2
+ <p>something<sup id="fnref:note1"><a href="#fn:note1" class="footnote">1</a></sup>.</p>
3
+
4
+ <h1>Footnotes</h1>
5
+
6
+ <h1>Test</h1>
7
+ <div class="footnotes">
8
+ <ol>
9
+ <li id="fn:note1">
10
+
11
+ <p>A note <a href="#fnref:note1" class="reversefootnote">&#8617;</a></p>
12
+ </li>
13
+ </ol>
14
+ </div>
@@ -28,3 +28,11 @@ Mark&rsquo;s name. &ldquo;&hellip;you&rdquo;
28
28
  <p>&ldquo;<em>Hurrah!</em>&rdquo;</p>
29
29
 
30
30
  <p>&lsquo;<strong>Absolutely</strong>.&rsquo;</p>
31
+
32
+ <p>&ldquo;&hellip;some Text&rdquo;</p>
33
+
34
+ <p>&ldquo;&hellip; some Text&rdquo;</p>
35
+
36
+ <p>This: &ldquo;&hellip;some Text&rdquo;</p>
37
+
38
+ <p>This: &ldquo;&hellip; some Text&rdquo;</p>
@@ -28,3 +28,11 @@ Nam liber tempor
28
28
  "_Hurrah!_"
29
29
 
30
30
  '__Absolutely__.'
31
+
32
+ "...some Text"
33
+
34
+ "... some Text"
35
+
36
+ This: "...some Text"
37
+
38
+ This: "... some Text"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kramdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Leitner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-27 00:00:00.000000000 Z
11
+ date: 2015-07-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -563,6 +563,9 @@ files:
563
563
  - test/testcases/span/03_codespan/highlighting.text
564
564
  - test/testcases/span/03_codespan/normal.html
565
565
  - test/testcases/span/03_codespan/normal.text
566
+ - test/testcases/span/04_footnote/backlink_text.html
567
+ - test/testcases/span/04_footnote/backlink_text.options
568
+ - test/testcases/span/04_footnote/backlink_text.text
566
569
  - test/testcases/span/04_footnote/definitions.html
567
570
  - test/testcases/span/04_footnote/definitions.latex
568
571
  - test/testcases/span/04_footnote/definitions.text
@@ -577,6 +580,8 @@ files:
577
580
  - test/testcases/span/04_footnote/markers.text
578
581
  - test/testcases/span/04_footnote/placement.html
579
582
  - test/testcases/span/04_footnote/placement.text
583
+ - test/testcases/span/04_footnote/regexp_problem.html
584
+ - test/testcases/span/04_footnote/regexp_problem.text
580
585
  - test/testcases/span/05_html/across_lines.html
581
586
  - test/testcases/span/05_html/across_lines.text
582
587
  - test/testcases/span/05_html/button.html