kramdown 1.9.0 → 1.10.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.

Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTERS +6 -2
  3. data/VERSION +1 -1
  4. data/doc/index.page +2 -2
  5. data/doc/syntax.page +13 -10
  6. data/lib/kramdown/converter/base.rb +3 -3
  7. data/lib/kramdown/converter/html.rb +2 -1
  8. data/lib/kramdown/converter/kramdown.rb +1 -1
  9. data/lib/kramdown/converter/math_engine/mathjaxnode.rb +14 -6
  10. data/lib/kramdown/converter/syntax_highlighter/coderay.rb +3 -0
  11. data/lib/kramdown/document.rb +3 -3
  12. data/lib/kramdown/element.rb +4 -0
  13. data/lib/kramdown/parser/gfm.rb +28 -1
  14. data/lib/kramdown/parser/html.rb +2 -2
  15. data/lib/kramdown/parser/kramdown/autolink.rb +1 -1
  16. data/lib/kramdown/parser/kramdown/codeblock.rb +6 -3
  17. data/lib/kramdown/parser/kramdown/extensions.rb +2 -1
  18. data/lib/kramdown/parser/kramdown/link.rb +1 -1
  19. data/lib/kramdown/version.rb +1 -1
  20. data/test/test_files.rb +5 -1
  21. data/test/testcases/block/06_codeblock/rouge/simple.html +4 -0
  22. data/test/testcases/block/06_codeblock/rouge/simple.text +5 -0
  23. data/test/testcases/block/06_codeblock/with_lang_in_fenced_block_any_char.html +8 -0
  24. data/test/testcases/block/06_codeblock/with_lang_in_fenced_block_any_char.options +2 -0
  25. data/test/testcases/block/06_codeblock/with_lang_in_fenced_block_any_char.text +11 -0
  26. data/test/testcases/span/01_link/empty.html +1 -1
  27. data/test/testcases/span/05_html/mark_element.html +3 -0
  28. data/test/testcases/span/05_html/mark_element.text +3 -0
  29. data/test/testcases/span/autolinks/url_links.html +1 -0
  30. data/test/testcases/span/autolinks/url_links.text +1 -0
  31. data/test/testcases_gfm/strikethrough.html +27 -0
  32. data/test/testcases_gfm/strikethrough.html.19 +27 -0
  33. data/test/testcases_gfm/strikethrough.text +27 -0
  34. metadata +11 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b045f72be4add1c589c1aa766c9e5645cbd8cae8
4
- data.tar.gz: 8e957bbb6eb55cbbde3f8a6c12cf6105d9ba0732
3
+ metadata.gz: 2b6f2cf839ac06d2599c5b3b973045b114086f82
4
+ data.tar.gz: 0cf9626a31156f2e2c7d993041953ffa9c33f04e
5
5
  SHA512:
6
- metadata.gz: f9e6675ca778e414d8add2d34d20f618c8b7181c273d2370329488533c451aa58dbd151d67cc0e5ececf852080f16782e342fd6a3f197389dcf43d9806fa31a8
7
- data.tar.gz: 39db36de2b2b8c216111e31a091b3f8e4fc9ed2c8bd8cb12d0dc0e0a635f9281a919ff2df503cc0e4e770c1e3c3e9d0a95a5cf8cd5625aa3c8b490525ce51b72
6
+ metadata.gz: d62ca19bbaaa0a42dcd61042782f0e18a1591c136948e9495e8ec193f1f5ddac3ec1f2916196c8d2c1e094ad3a3057be2a8d660072bad4cbf98f1ad75e2e7048
7
+ data.tar.gz: fa8218c25f56a99b9f749cb6da57f44794394ce623a20ac8aa26a858cb8a08c26f1caac0dcabaf6367846980a81b47cd2158cbe84b79631c49c29a62885c80c1
@@ -1,6 +1,6 @@
1
1
  Count Name
2
2
  ======= ====
3
- 781 Thomas Leitner <t_leitner@gmx.at>
3
+ 789 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>
@@ -9,6 +9,8 @@
9
9
  3 Brandur <brandur@mutelight.org>
10
10
  3 Ben Armston <ben.armston@googlemail.com>
11
11
  3 Alex Marandon <contact@alexmarandon.com>
12
+ 2 Tom Thorogood <me+github@tomthorogood.co.uk>
13
+ 2 Parker Moore <parkrmoore@gmail.com>
12
14
  2 Nathanael Jones <nathanael.jones@gmail.com>
13
15
  2 Max Meyer <dev@fedux.org>
14
16
  2 Jo Hund <jhund@clearcove.ca>
@@ -17,10 +19,10 @@
17
19
  1 utenmiki <utenmiki@gmail.com>
18
20
  1 Trevor Wennblom <trevor@well.com>
19
21
  1 tomykaira <tomykaira@gmail.com>
20
- 1 Tom Thorogood <me+github@tomthorogood.co.uk>
21
22
  1 Tim Blair <tim@bla.ir>
22
23
  1 Tim Besard <tim.besard@gmail.com>
23
24
  1 Tim Bates <tim@rumpuslabs.com>
25
+ 1 Sun Yaozhu <yzyzsun@gmail.com>
24
26
  1 Simon Lydell <simon.lydell@gmail.com>
25
27
  1 Shusaku NAKAZATO <cu393uc@gmail.com>
26
28
  1 Sebastian Boehm <sebastian@sometimesfood.org>
@@ -38,5 +40,7 @@
38
40
  1 Jens Kraemer <jk@jkraemer.net>
39
41
  1 Hector Correa <hector@hectorcorrea.com>
40
42
  1 Floreal Morandat florealm@gmail.com <florealm@gmail.com>
43
+ 1 Diego Galeota <diegobg123@gmail.com>
41
44
  1 Damien Pollet <damien.pollet@gmail.com>
45
+ 1 Christopher Jefferson <caj21@st-andrews.ac.uk>
42
46
  1 Alex Tomlins <alex.tomlins@digital.cabinet-office.gov.uk>
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.9.0
1
+ 1.10.0
@@ -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.9.0**{:itemprop="softwareVersion"} released on
101
- **2015-10-01**{:itemprop="datePublished"}, [more news](news.html)
100
+ Version **1.10.0**{:itemprop="softwareVersion"} released on
101
+ **2016-03-02**{:itemprop="datePublished"}, [more news](news.html)
102
102
  {: style="text-align: center; font-size: 80%"}
103
103
 
104
104
  </div>
@@ -1136,9 +1136,9 @@ As the wording suggests, inline links provide all information inline in the text
1136
1136
  style links only provide the link text in the text flow and everything else is defined
1137
1137
  elsewhere. This also allows you to reuse link definitions.
1138
1138
 
1139
- An inline style link can be created by surrounding the link text which must contain at least one
1140
- character with square brackets, followed immediately by the link URL (and an optional title in
1141
- single or double quotes preceded by at least one space) in normal parentheses. For example:
1139
+ An inline style link can be created by surrounding the link text with square brackets, followed
1140
+ immediately by the link URL (and an optional title in single or double quotes preceded by at least
1141
+ one space) in normal parentheses. For example:
1142
1142
 
1143
1143
  This is [a link](http://rubyforge.org) to a page.
1144
1144
  A [link](../test "local URI") can also have a title.
@@ -1150,6 +1150,8 @@ Notes:
1150
1150
  However, if you use square brackets within the link text, you have to either properly nest them or
1151
1151
  to escape them. It is not possible to create nested links!
1152
1152
 
1153
+ The link text may also be omitted, e.g. for creating link anchors.
1154
+
1153
1155
  * The link URL has to contain properly nested parentheses if no title is specified, or the link URL
1154
1156
  must be contained in angle brackets (incorrectly nested parentheses are allowed).
1155
1157
 
@@ -1222,9 +1224,8 @@ used on them to specify additional attributes for the links:
1222
1224
 
1223
1225
  Images can be specified via a syntax that is similar to the one used by links. The difference is
1224
1226
  that you have to use an exclamation mark before the first square bracket and that the link text of a
1225
- normal link, which may also be the empty string in case of image links, becomes the alternative text
1226
- of the image link. As with normal links, image links can be written inline or reference style. For
1227
- example:
1227
+ normal link becomes the alternative text of the image link. As with normal links, image links can be
1228
+ written inline or reference style. For example:
1228
1229
 
1229
1230
  Here comes a ![smiley](../images/smiley.png)! And here
1230
1231
  ![too](../images/other.png 'Title text'). Or ![here].
@@ -1583,10 +1584,12 @@ ID name
1583
1584
 
1584
1585
  class names
1585
1586
 
1586
- : A class name is defined by using a dot and then the class name. This is (almost, but not quite) a
1587
- short hand for the key-value pair `class="class-name"`. Almost because it actually means that the
1588
- class name should be appended to the current value of the `class` attribute. The following ALDs
1589
- are all equivalent:
1587
+ : A class name is defined by using a dot and then the class name which may contain any character
1588
+ except whitespace, the dot character and the hash character.
1589
+
1590
+ This is (almost, but not quite) a short hand for the key-value pair `class="class-name"`. Almost
1591
+ because it actually means that the class name should be appended to the current value of the
1592
+ `class` attribute. The following ALDs are all equivalent:
1590
1593
 
1591
1594
  {:id: .cls1 .cls2}
1592
1595
  {:id: class="cls1" .cls2}
@@ -182,8 +182,8 @@ module Kramdown
182
182
 
183
183
  # Extract the code block/span language from the attributes.
184
184
  def extract_code_language(attr)
185
- if attr['class'] && attr['class'] =~ /\blanguage-\w[\w-]*\b/
186
- attr['class'].scan(/\blanguage-(\w[\w-]*)\b/).first.first
185
+ if attr['class'] && attr['class'] =~ /\blanguage-\S+/
186
+ attr['class'].scan(/\blanguage-(\S+)/).first.first
187
187
  end
188
188
  end
189
189
 
@@ -192,7 +192,7 @@ module Kramdown
192
192
  # *Warning*: This version will modify the given attributes if a language is present.
193
193
  def extract_code_language!(attr)
194
194
  lang = extract_code_language(attr)
195
- attr['class'] = attr['class'].sub(/\blanguage-\w[\w-]*\b/, '').strip if lang
195
+ attr['class'] = attr['class'].sub(/\blanguage-\S+/, '').strip if lang
196
196
  attr.delete('class') if lang && attr['class'].empty?
197
197
  lang
198
198
  end
@@ -92,6 +92,7 @@ module Kramdown
92
92
  def convert_codeblock(el, indent)
93
93
  attr = el.attr.dup
94
94
  lang = extract_code_language!(attr)
95
+ lang = el.options[:lang] if el.options.has_key?(:lang)
95
96
  highlighted_code = highlight_code(el.value, lang, :block)
96
97
 
97
98
  if highlighted_code
@@ -112,7 +113,7 @@ module Kramdown
112
113
  end
113
114
  end
114
115
  code_attr = {}
115
- code_attr['class'] = "language-#{lang}" if lang
116
+ code_attr['class'] = "language-#{lang.sub(/\?.*$/, '')}" if lang
116
117
  "#{' '*indent}<pre#{html_attributes(attr)}><code#{html_attributes(code_attr)}>#{result}\n</code></pre>\n"
117
118
  end
118
119
  end
@@ -402,7 +402,7 @@ module Kramdown
402
402
  next if el.type == :header && k == 'id' && !v.strip.empty?
403
403
  if v.nil?
404
404
  ''
405
- elsif k == 'class' && !v.empty?
405
+ elsif k == 'class' && !v.empty? && !v.index(/[\.#]/)
406
406
  " " + v.split(/\s+/).map {|w| ".#{w}"}.join(" ")
407
407
  elsif k == 'id' && !v.strip.empty?
408
408
  " ##{v}"
@@ -9,19 +9,27 @@
9
9
 
10
10
  module Kramdown::Converter::MathEngine
11
11
 
12
- # Uses the MathJax-node library for converting math formulas to MathML.
12
+ # Uses the mathjax-node library for converting math formulas to MathML.
13
13
  module MathjaxNode
14
14
 
15
15
  # MathjaxNode is available if this constant is +true+.
16
16
  AVAILABLE = RUBY_VERSION >= '1.9' && begin
17
- npm = %x{npm --global --depth=1 list MathJax-node}
17
+ %x{node --version}[1..-2] >= '4.0'
18
+ rescue
19
+ begin
20
+ %x{nodejs --version}[1..-2] >= '4.0'
21
+ rescue
22
+ false
23
+ end
24
+ end && begin
25
+ npm = %x{npm --global --depth=1 list mathjax-node 2>&1}
18
26
 
19
- unless /MathJax-node@/ === npm.lines.drop(1).join("\n")
20
- npm = %x{npm --depth=1 list MathJax-node}
27
+ unless /mathjax-node@/ === npm.lines.drop(1).join("\n")
28
+ npm = %x{npm --depth=1 list mathjax-node 2>&1}
21
29
  end
22
30
 
23
- T2MPATH = File.join(npm.lines.first.strip, "node_modules/MathJax-node/bin/tex2mml")
24
- /MathJax-node@/ === npm.lines.drop(1).join("\n") && File.exist?(T2MPATH)
31
+ T2MPATH = File.join(npm.lines.first.strip, "node_modules/mathjax-node/bin/tex2mml")
32
+ /mathjax-node@/ === npm.lines.drop(1).join("\n") && File.exist?(T2MPATH)
25
33
  rescue
26
34
  false
27
35
  end
@@ -32,6 +32,9 @@ module Kramdown::Converter::SyntaxHighlighter
32
32
  else
33
33
  nil
34
34
  end
35
+ rescue
36
+ converter.warning("There was an error using CodeRay: #{$!.message}")
37
+ nil
35
38
  end
36
39
 
37
40
  def self.options(converter, type)
@@ -29,7 +29,7 @@
29
29
  #
30
30
  # Kramdown::Document.new(text).to_html
31
31
  #
32
- # For detailed information have a look at the Kramdown::Document class.
32
+ # For detailed information have a look at the *\Kramdown::Document* class.
33
33
  #
34
34
  # == License
35
35
  #
@@ -100,13 +100,13 @@ module Kramdown
100
100
  # immediately available and the output can be generated.
101
101
  def initialize(source, options = {})
102
102
  @options = Options.merge(options).freeze
103
- parser = (options[:input] || 'kramdown').to_s
103
+ parser = (@options[:input] || 'kramdown').to_s
104
104
  parser = parser[0..0].upcase + parser[1..-1]
105
105
  try_require('parser', parser)
106
106
  if Parser.const_defined?(parser)
107
107
  @root, @warnings = Parser.const_get(parser).parse(source, @options)
108
108
  else
109
- raise Kramdown::Error.new("kramdown has no parser to handle the specified input format: #{options[:input]}")
109
+ raise Kramdown::Error.new("kramdown has no parser to handle the specified input format: #{@options[:input]}")
110
110
  end
111
111
  end
112
112
 
@@ -98,6 +98,10 @@ module Kramdown
98
98
  #
99
99
  # The +value+ field has to contain the content of the code block.
100
100
  #
101
+ # The option :lang specifies a highlighting language with possible HTML style options (e.g.
102
+ # php?start_inline=1) and should be used instead of a possibly also available language embedded in
103
+ # a class name of the form 'language-LANG'.
104
+ #
101
105
  #
102
106
  # === :ul
103
107
  #
@@ -23,6 +23,10 @@ module Kramdown
23
23
  @block_parsers.delete(current)
24
24
  @block_parsers.insert(i, replacement)
25
25
  end
26
+
27
+ i = @span_parsers.index(:escaped_chars)
28
+ @span_parsers[i] = :escaped_chars_gfm if i
29
+ @span_parsers << :strikethrough_gfm
26
30
  end
27
31
 
28
32
  def parse
@@ -57,9 +61,32 @@ module Kramdown
57
61
  ATX_HEADER_START = /^\#{1,6}\s/
58
62
  define_parser(:atx_header_gfm, ATX_HEADER_START, nil, 'parse_atx_header')
59
63
 
60
- FENCED_CODEBLOCK_MATCH = /^(([~`]){3,})\s*?(\w[\w-]*)?\s*?\n(.*?)^\1\2*\s*?\n/m
64
+ FENCED_CODEBLOCK_MATCH = /^(([~`]){3,})\s*?((\S+)(?:\?\S*)?)?\s*?\n(.*?)^\1\2*\s*?\n/m
61
65
  define_parser(:codeblock_fenced_gfm, /^[~`]{3,}/, nil, 'parse_codeblock_fenced')
62
66
 
67
+ STRIKETHROUGH_DELIM = /~~/
68
+ STRIKETHROUGH_MATCH = /#{STRIKETHROUGH_DELIM}[^\s~](.*?)[^\s~]#{STRIKETHROUGH_DELIM}/m
69
+ define_parser(:strikethrough_gfm, STRIKETHROUGH_MATCH, '~~')
70
+
71
+ def parse_strikethrough_gfm
72
+ line_number = @src.current_line_number
73
+
74
+ @src.pos += @src.matched_size
75
+ el = Element.new(:html_element, 'del', {}, :category => :span, :line => line_number)
76
+ @tree.children << el
77
+
78
+ env = save_env
79
+ reset_env(:src => Kramdown::Utils::StringScanner.new(@src.matched[2..-3], line_number),
80
+ :text_type => :text)
81
+ parse_spans(el)
82
+ restore_env(env)
83
+
84
+ el
85
+ end
86
+
87
+ ESCAPED_CHARS_GFM = /\\([\\.*_+`<>()\[\]{}#!:\|"'\$=\-~])/
88
+ define_parser(:escaped_chars_gfm, ESCAPED_CHARS_GFM, '\\\\', :parse_escaped_chars)
89
+
63
90
  end
64
91
  end
65
92
  end
@@ -53,7 +53,7 @@ module Kramdown
53
53
  # span HTML) and don't appear therefore!
54
54
  # script, textarea
55
55
  HTML_SPAN_ELEMENTS = %w{a abbr acronym b big bdo br button cite code del dfn em i img input
56
- ins kbd label option q rb rbc rp rt rtc ruby samp select small span
56
+ ins kbd label mark option q rb rbc rp rt rtc ruby samp select small span
57
57
  strong sub sup tt u var}
58
58
  HTML_BLOCK_ELEMENTS = %w{address article aside applet body blockquote caption col colgroup dd div dl dt fieldset
59
59
  figcaption footer form h1 h2 h3 h4 h5 h6 header hgroup hr html head iframe legend menu
@@ -421,7 +421,7 @@ module Kramdown
421
421
  else
422
422
  set_basics(el, :codeblock)
423
423
  if el.children.size == 1 && el.children.first.value == 'code'
424
- value = (el.children.first.attr['class'] || '').scan(/\blanguage-\w[\w-]*\b/).first
424
+ value = (el.children.first.attr['class'] || '').scan(/\blanguage-\S+/).first
425
425
  el.attr['class'] = "#{value} #{el.attr['class']}".rstrip if value
426
426
  end
427
427
  end
@@ -16,7 +16,7 @@ module Kramdown
16
16
  elsif RUBY_VERSION < '1.9.0'
17
17
  ACHARS = '\w'
18
18
  else
19
- ACHARS = '[[:alnum:]]'
19
+ ACHARS = '[[:alnum:]]_'
20
20
  end
21
21
  AUTOLINK_START_STR = "<((mailto|https?|ftps?):.+?|[-.#{ACHARS}]+@[-#{ACHARS}]+(?:\.[-#{ACHARS}]+)*\.[a-z]+)>"
22
22
  AUTOLINK_START = /#{AUTOLINK_START_STR}/u
@@ -32,16 +32,19 @@ module Kramdown
32
32
 
33
33
 
34
34
  FENCED_CODEBLOCK_START = /^~{3,}/
35
- FENCED_CODEBLOCK_MATCH = /^((~){3,})\s*?(\w[\w-]*)?\s*?\n(.*?)^\1\2*\s*?\n/m
35
+ FENCED_CODEBLOCK_MATCH = /^((~){3,})\s*?((\S+?)(?:\?\S*)?)?\s*?\n(.*?)^\1\2*\s*?\n/m
36
36
 
37
37
  # Parse the fenced codeblock at the current location.
38
38
  def parse_codeblock_fenced
39
39
  if @src.check(self.class::FENCED_CODEBLOCK_MATCH)
40
40
  start_line_number = @src.current_line_number
41
41
  @src.pos += @src.matched_size
42
- el = new_block_el(:codeblock, @src[4], nil, :location => start_line_number)
42
+ el = new_block_el(:codeblock, @src[5], nil, :location => start_line_number)
43
43
  lang = @src[3].to_s.strip
44
- el.attr['class'] = "language-#{lang}" unless lang.empty?
44
+ unless lang.empty?
45
+ el.options[:lang] = lang
46
+ el.attr['class'] = "language-#{@src[4]}"
47
+ end
45
48
  @tree.children << el
46
49
  true
47
50
  else
@@ -128,8 +128,9 @@ module Kramdown
128
128
  ALD_ID_CHARS = /[\w-]/
129
129
  ALD_ANY_CHARS = /\\\}|[^\}]/
130
130
  ALD_ID_NAME = /\w#{ALD_ID_CHARS}*/
131
+ ALD_CLASS_NAME = /[^\s\.#]+/
131
132
  ALD_TYPE_KEY_VALUE_PAIR = /(#{ALD_ID_NAME})=("|')((?:\\\}|\\\2|[^\}\2])*?)\2/
132
- ALD_TYPE_CLASS_NAME = /\.(-?#{ALD_ID_NAME})/
133
+ ALD_TYPE_CLASS_NAME = /\.(#{ALD_CLASS_NAME})/
133
134
  ALD_TYPE_ID_NAME = /#([A-Za-z][\w:-]*)/
134
135
  ALD_TYPE_ID_OR_CLASS = /#{ALD_TYPE_ID_NAME}|#{ALD_TYPE_CLASS_NAME}/
135
136
  ALD_TYPE_ID_OR_CLASS_MULTI = /((?:#{ALD_TYPE_ID_NAME}|#{ALD_TYPE_CLASS_NAME})+)/
@@ -77,7 +77,7 @@ module Kramdown
77
77
  count = count + (@src[1] ? -1 : 1)
78
78
  count - el.children.select {|c| c.type == :img}.size == 0
79
79
  end
80
- if !found || (link_type == :a && el.children.empty?)
80
+ unless found
81
81
  @src.revert_pos(saved_pos)
82
82
  add_text(result)
83
83
  return
@@ -10,6 +10,6 @@
10
10
  module Kramdown
11
11
 
12
12
  # The kramdown version.
13
- VERSION = '1.9.0'
13
+ VERSION = '1.10.0'
14
14
 
15
15
  end
@@ -64,6 +64,7 @@ class TestFiles < Minitest::Test
64
64
  'test/testcases/span/math/mathjaxnode.html', # bc of tidy
65
65
  'test/testcases/block/15_math/mathjax_preview.html', # bc of mathjax preview
66
66
  'test/testcases/block/15_math/mathjax_preview_simple.html', # bc of mathjax preview
67
+ 'test/testcases/span/05_html/mark_element.html', # bc of tidy
67
68
  ].compact
68
69
  EXCLUDE_HTML_TEXT_FILES = ['test/testcases/block/09_html/parse_as_span.htmlinput',
69
70
  'test/testcases/block/09_html/parse_as_raw.htmlinput',
@@ -117,6 +118,7 @@ class TestFiles < Minitest::Test
117
118
  'test/testcases/span/01_link/empty_title.text',
118
119
  'test/testcases/span/04_footnote/markers.text', # bc of footnote in header
119
120
  'test/testcases/block/06_codeblock/with_lang_in_fenced_block_name_with_dash.text',
121
+ 'test/testcases/block/06_codeblock/with_lang_in_fenced_block_any_char.text',
120
122
  ].compact
121
123
  Dir[File.dirname(__FILE__) + '/testcases/**/*.text'].each do |text_file|
122
124
  next if EXCLUDE_LATEX_FILES.any? {|f| text_file =~ /#{f}$/}
@@ -156,7 +158,7 @@ class TestFiles < Minitest::Test
156
158
  ('test/testcases/block/04_header/with_auto_ids.text' if RUBY_VERSION <= '1.8.6'), # bc of dep stringex not working
157
159
  ('test/testcases/span/03_codespan/rouge/simple.text' if RUBY_VERSION < '2.0'), #bc of rouge
158
160
  ('test/testcases/span/03_codespan/rouge/disabled.text' if RUBY_VERSION < '2.0'), #bc of rouge
159
- ('test/testcases/block/06_codeblock/rouge/simple.text' if RUBY_VERSION < '2.0'), #bc of rouge
161
+ 'test/testcases/block/06_codeblock/rouge/simple.text',
160
162
  'test/testcases/block/15_math/ritex.text', # bc of tidy
161
163
  'test/testcases/span/math/ritex.text', # bc of tidy
162
164
  'test/testcases/block/15_math/itex2mml.text', # bc of tidy
@@ -166,6 +168,7 @@ class TestFiles < Minitest::Test
166
168
  'test/testcases/block/15_math/mathjaxnode_semantics.text', # bc of tidy
167
169
  'test/testcases/span/math/mathjaxnode.text', # bc of tidy
168
170
  'test/testcases/span/01_link/link_defs_with_ial.text', # bc of attribute ordering
171
+ 'test/testcases/span/05_html/mark_element.text', # bc of tidy
169
172
  ].compact
170
173
  Dir[File.dirname(__FILE__) + '/testcases/**/*.text'].each do |text_file|
171
174
  next if EXCLUDE_TEXT_FILES.any? {|f| text_file =~ /#{f}$/}
@@ -215,6 +218,7 @@ class TestFiles < Minitest::Test
215
218
  'test/testcases/block/15_math/mathjax_preview.html', # bc of mathjax preview
216
219
  'test/testcases/block/15_math/mathjax_preview_simple.html', # bc of mathjax preview
217
220
  'test/testcases/span/01_link/link_defs_with_ial.html', # bc of attribute ordering
221
+ 'test/testcases/span/05_html/mark_element.html', # bc of tidy
218
222
  ].compact
219
223
  Dir[File.dirname(__FILE__) + '/testcases/**/*.{html,html.19}'].each do |html_file|
220
224
  next if EXCLUDE_HTML_KD_FILES.any? {|f| html_file =~ /#{f}(\.19)?$/}
@@ -4,3 +4,7 @@
4
4
  <div class="highlighter-rouge"><pre class="highlight"><code><span class="nt">&lt;a&gt;</span>href<span class="nt">&lt;/a&gt;</span>
5
5
  </code></pre>
6
6
  </div>
7
+
8
+ <div class="highlighter-rouge"><pre class="highlight"><code><span class="nv">$foo</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Bar</span><span class="p">;</span>
9
+ </code></pre>
10
+ </div>
@@ -2,3 +2,8 @@
2
2
  ^
3
3
  <a>href</a>
4
4
  {: .language-html}
5
+
6
+
7
+ ~~~ php?start_inline=1
8
+ $foo = new Bar;
9
+ ~~~
@@ -0,0 +1,8 @@
1
+ <pre><code class="language-asn.1">text
2
+ </code></pre>
3
+
4
+ <pre><code class="language-asn#w1">text
5
+ </code></pre>
6
+
7
+ <pre><code class="language-русский">text
8
+ </code></pre>
@@ -0,0 +1,11 @@
1
+ ~~~ asn.1
2
+ text
3
+ ~~~
4
+
5
+ ~~~ asn#w1
6
+ text
7
+ ~~~
8
+
9
+ ~~~ русский
10
+ text
11
+ ~~~
@@ -2,4 +2,4 @@
2
2
 
3
3
  <p>This is [][] empty.</p>
4
4
 
5
- <p>This is [](test.html) empty.</p>
5
+ <p>This is <a href="test.html"></a> empty.</p>
@@ -0,0 +1,3 @@
1
+ <p>Lorem ipsum.</p>
2
+
3
+ <p><mark>Test</mark></p>
@@ -0,0 +1,3 @@
1
+ Lorem ipsum.
2
+
3
+ <mark>Test</mark>
@@ -1,6 +1,7 @@
1
1
  <p>This should be a <a href="http://www.example.com/">http://www.example.com/</a> link.
2
2
  This should be a <a href="&#109;&#097;&#105;&#108;&#116;&#111;:&#106;&#111;&#104;&#110;&#046;&#100;&#111;&#101;&#064;&#101;&#120;&#097;&#109;&#112;&#108;&#101;&#046;&#099;&#111;&#109;">&#106;&#111;&#104;&#110;&#046;&#100;&#111;&#101;&#064;&#101;&#120;&#097;&#109;&#112;&#108;&#101;&#046;&#099;&#111;&#109;</a> link.
3
3
  As should <a href="&#109;&#097;&#105;&#108;&#116;&#111;:&#106;&#111;&#104;&#110;&#046;&#100;&#111;&#101;&#064;&#101;&#120;&#097;&#109;&#112;&#108;&#101;&#046;&#099;&#111;&#109;">&#106;&#111;&#104;&#110;&#046;&#100;&#111;&#101;&#064;&#101;&#120;&#097;&#109;&#112;&#108;&#101;&#046;&#099;&#111;&#109;</a> this.
4
+ As should <a href="&#109;&#097;&#105;&#108;&#116;&#111;:&#106;&#111;&#104;&#110;&#095;&#100;&#111;&#101;&#064;&#101;&#120;&#097;&#109;&#112;&#108;&#101;&#046;&#099;&#111;&#109;">&#106;&#111;&#104;&#110;&#095;&#100;&#111;&#101;&#064;&#101;&#120;&#097;&#109;&#112;&#108;&#101;&#046;&#099;&#111;&#109;</a> this.
4
5
  As should <a href="&#109;&#097;&#105;&#108;&#116;&#111;:&#067;&#083;&#083;&#064;&#101;&#120;&#097;&#109;&#112;&#108;&#101;&#046;&#099;&#111;&#109;"><abbr title="Cascading">CSS</abbr>@example.com</a> this.
5
6
  Another ampersand <a href="http://www.example.com/?doit&amp;x=y">http://www.example.com/?doit&amp;x=y</a> link.
6
7
  More entities <a href="http://www.example.com/?doit&amp;x=&quot;y&amp;z=y">http://www.example.com/?doit&amp;x=&quot;y&amp;z=y</a>.</p>
@@ -1,6 +1,7 @@
1
1
  This should be a <http://www.example.com/> link.
2
2
  This should be a <mailto:john.doe@example.com> link.
3
3
  As should <john.doe@example.com> this.
4
+ As should <john_doe@example.com> this.
4
5
  As should <CSS@example.com> this.
5
6
  Another ampersand <http://www.example.com/?doit&x=y> link.
6
7
  More entities <http://www.example.com/?doit&amp;x=&quot;y&z=y>.
@@ -0,0 +1,27 @@
1
+ <p><del>This is a test</del></p>
2
+
3
+ <p>~<del>This is another test</del>~</p>
4
+
5
+ <p><del>This is yet another test</del>~</p>
6
+
7
+ <p>~~ This is a test of it NOT working ~~</p>
8
+
9
+ <p>~~<br />
10
+ This<br />
11
+ is<br />
12
+ a<br />
13
+ <strong>multiline</strong><br />
14
+ test<br />
15
+ ~~</p>
16
+
17
+ <p>This is an <del><em>inline</em> <strong>strikethrough</strong></del> test</p>
18
+
19
+ <p>This is an ~~escaped~~ strikethrough.</p>
20
+
21
+ <p>This is a <del>strikethrough with a ~ in the middle</del></p>
22
+
23
+ <p>I <del>don&#8217;t even</del>~ have an extra tilde.</p>
24
+
25
+ <p>This should ~~not be struck.</p>
26
+
27
+ <p>This <del>is a complex <em>strike</em> through *test ~~with nesting</del> involved* here~~.</p>
@@ -0,0 +1,27 @@
1
+ <p><del>This is a test</del></p>
2
+
3
+ <p>~<del>This is another test</del>~</p>
4
+
5
+ <p><del>This is yet another test</del>~</p>
6
+
7
+ <p>~~ This is a test of it NOT working ~~</p>
8
+
9
+ <p>~~<br />
10
+ This<br />
11
+ is<br />
12
+ a<br />
13
+ <strong>multiline</strong><br />
14
+ test<br />
15
+ ~~</p>
16
+
17
+ <p>This is an <del><em>inline</em> <strong>strikethrough</strong></del> test</p>
18
+
19
+ <p>This is an ~~escaped~~ strikethrough.</p>
20
+
21
+ <p>This is a <del>strikethrough with a ~ in the middle</del></p>
22
+
23
+ <p>I <del>don’t even</del>~ have an extra tilde.</p>
24
+
25
+ <p>This should ~~not be struck.</p>
26
+
27
+ <p>This <del>is a complex <em>strike</em> through *test ~~with nesting</del> involved* here~~.</p>
@@ -0,0 +1,27 @@
1
+ ~~This is a test~~
2
+
3
+ ~~~This is another test~~~
4
+
5
+ ~~This is yet another test~~~
6
+
7
+ ~~ This is a test of it NOT working ~~
8
+
9
+ ~~
10
+ This
11
+ is
12
+ a
13
+ **multiline**
14
+ test
15
+ ~~
16
+
17
+ This is an ~~_inline_ **strikethrough**~~ test
18
+
19
+ This is an \~~escaped~~ strikethrough.
20
+
21
+ This is a ~~strikethrough with a ~ in the middle~~
22
+
23
+ I ~~don't even~~~ have an extra tilde.
24
+
25
+ This should ~~not be struck.
26
+
27
+ This ~~is a complex *strike* through *test ~~with nesting~~ involved* here~~.
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.9.0
4
+ version: 1.10.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-10-01 00:00:00.000000000 Z
11
+ date: 2016-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -318,6 +318,9 @@ files:
318
318
  - test/testcases/block/06_codeblock/with_lang_in_fenced_block.html
319
319
  - test/testcases/block/06_codeblock/with_lang_in_fenced_block.options
320
320
  - test/testcases/block/06_codeblock/with_lang_in_fenced_block.text
321
+ - test/testcases/block/06_codeblock/with_lang_in_fenced_block_any_char.html
322
+ - test/testcases/block/06_codeblock/with_lang_in_fenced_block_any_char.options
323
+ - test/testcases/block/06_codeblock/with_lang_in_fenced_block_any_char.text
321
324
  - test/testcases/block/06_codeblock/with_lang_in_fenced_block_name_with_dash.html
322
325
  - test/testcases/block/06_codeblock/with_lang_in_fenced_block_name_with_dash.options
323
326
  - test/testcases/block/06_codeblock/with_lang_in_fenced_block_name_with_dash.text
@@ -600,6 +603,8 @@ files:
600
603
  - test/testcases/span/05_html/invalid.text
601
604
  - test/testcases/span/05_html/link_with_mailto.html
602
605
  - test/testcases/span/05_html/link_with_mailto.text
606
+ - test/testcases/span/05_html/mark_element.html
607
+ - test/testcases/span/05_html/mark_element.text
603
608
  - test/testcases/span/05_html/markdown_attr.html
604
609
  - test/testcases/span/05_html/markdown_attr.text
605
610
  - test/testcases/span/05_html/normal.html
@@ -673,6 +678,9 @@ files:
673
678
  - test/testcases_gfm/hard_line_breaks_off.html
674
679
  - test/testcases_gfm/hard_line_breaks_off.options
675
680
  - test/testcases_gfm/hard_line_breaks_off.text
681
+ - test/testcases_gfm/strikethrough.html
682
+ - test/testcases_gfm/strikethrough.html.19
683
+ - test/testcases_gfm/strikethrough.text
676
684
  - test/testcases_gfm/two_para_hard_line_breaks.html
677
685
  - test/testcases_gfm/two_para_hard_line_breaks.text
678
686
  homepage: http://kramdown.gettalong.org
@@ -697,7 +705,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
697
705
  version: '0'
698
706
  requirements: []
699
707
  rubyforge_project:
700
- rubygems_version: 2.4.6
708
+ rubygems_version: 2.5.1
701
709
  signing_key:
702
710
  specification_version: 4
703
711
  summary: kramdown is a fast, pure-Ruby Markdown-superset converter.