kramdown 1.10.0 → 1.11.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 +4 -4
- data/CONTRIBUTERS +1 -1
- data/Rakefile +2 -1
- data/VERSION +1 -1
- data/doc/default.template +2 -2
- data/doc/index.page +2 -2
- data/doc/installation.page +2 -2
- data/lib/kramdown.rb +1 -1
- data/lib/kramdown/compatibility.rb +1 -1
- data/lib/kramdown/converter.rb +1 -1
- data/lib/kramdown/converter/base.rb +1 -1
- data/lib/kramdown/converter/hash_ast.rb +1 -1
- data/lib/kramdown/converter/html.rb +12 -9
- data/lib/kramdown/converter/kramdown.rb +1 -1
- data/lib/kramdown/converter/latex.rb +1 -1
- data/lib/kramdown/converter/math_engine/itex2mml.rb +1 -1
- data/lib/kramdown/converter/math_engine/mathjax.rb +1 -1
- data/lib/kramdown/converter/math_engine/mathjaxnode.rb +1 -1
- data/lib/kramdown/converter/math_engine/ritex.rb +1 -1
- data/lib/kramdown/converter/pdf.rb +1 -1
- data/lib/kramdown/converter/remove_html_tags.rb +1 -1
- data/lib/kramdown/converter/syntax_highlighter.rb +4 -1
- data/lib/kramdown/converter/syntax_highlighter/coderay.rb +4 -4
- data/lib/kramdown/converter/syntax_highlighter/minted.rb +1 -1
- data/lib/kramdown/converter/syntax_highlighter/rouge.rb +3 -2
- data/lib/kramdown/converter/toc.rb +1 -1
- data/lib/kramdown/document.rb +1 -1
- data/lib/kramdown/element.rb +1 -1
- data/lib/kramdown/error.rb +1 -1
- data/lib/kramdown/options.rb +1 -1
- data/lib/kramdown/parser.rb +1 -1
- data/lib/kramdown/parser/base.rb +1 -1
- data/lib/kramdown/parser/gfm.rb +2 -2
- data/lib/kramdown/parser/html.rb +18 -7
- data/lib/kramdown/parser/kramdown.rb +1 -1
- data/lib/kramdown/parser/kramdown/abbreviation.rb +1 -1
- data/lib/kramdown/parser/kramdown/autolink.rb +1 -1
- data/lib/kramdown/parser/kramdown/blank_line.rb +1 -1
- data/lib/kramdown/parser/kramdown/block_boundary.rb +1 -1
- data/lib/kramdown/parser/kramdown/blockquote.rb +1 -1
- data/lib/kramdown/parser/kramdown/codeblock.rb +1 -1
- data/lib/kramdown/parser/kramdown/codespan.rb +1 -1
- data/lib/kramdown/parser/kramdown/emphasis.rb +2 -2
- data/lib/kramdown/parser/kramdown/eob.rb +1 -1
- data/lib/kramdown/parser/kramdown/escaped_chars.rb +1 -1
- data/lib/kramdown/parser/kramdown/extensions.rb +1 -1
- data/lib/kramdown/parser/kramdown/footnote.rb +1 -1
- data/lib/kramdown/parser/kramdown/header.rb +1 -1
- data/lib/kramdown/parser/kramdown/horizontal_rule.rb +1 -1
- data/lib/kramdown/parser/kramdown/html.rb +6 -4
- data/lib/kramdown/parser/kramdown/html_entity.rb +1 -1
- data/lib/kramdown/parser/kramdown/line_break.rb +1 -1
- data/lib/kramdown/parser/kramdown/link.rb +1 -1
- data/lib/kramdown/parser/kramdown/list.rb +1 -1
- data/lib/kramdown/parser/kramdown/math.rb +1 -1
- data/lib/kramdown/parser/kramdown/paragraph.rb +1 -1
- data/lib/kramdown/parser/kramdown/smart_quotes.rb +1 -1
- data/lib/kramdown/parser/kramdown/table.rb +1 -1
- data/lib/kramdown/parser/kramdown/typographic_symbol.rb +1 -1
- data/lib/kramdown/parser/markdown.rb +1 -1
- data/lib/kramdown/utils.rb +1 -1
- data/lib/kramdown/utils/configurable.rb +1 -1
- data/lib/kramdown/utils/entities.rb +1 -1
- data/lib/kramdown/utils/html.rb +1 -1
- data/lib/kramdown/utils/ordered_hash.rb +1 -1
- data/lib/kramdown/utils/string_scanner.rb +1 -1
- data/lib/kramdown/utils/unidecoder.rb +1 -1
- data/lib/kramdown/version.rb +2 -2
- data/test/run_tests.rb +1 -1
- data/test/test_files.rb +7 -1
- data/test/test_location.rb +1 -1
- data/test/test_string_scanner_kramdown.rb +1 -1
- data/test/testcases/block/06_codeblock/highlighting-opts.html +2 -2
- data/test/testcases/block/06_codeblock/highlighting.html +2 -2
- data/test/testcases/block/06_codeblock/rouge/simple.html +3 -3
- data/test/testcases/block/09_html/not_parsed.html +1 -1
- data/test/testcases/block/09_html/simple.html +0 -4
- data/test/testcases/block/09_html/simple.html.19 +0 -4
- data/test/testcases/block/09_html/simple.text +1 -5
- data/test/testcases/block/09_html/xml.html +8 -0
- data/test/testcases/block/09_html/xml.text +7 -0
- data/test/testcases/block/12_extension/options3.html +2 -2
- data/test/testcases/span/02_emphasis/normal.html +2 -0
- data/test/testcases/span/02_emphasis/normal.text +2 -0
- data/test/testcases/span/05_html/xml.html +5 -0
- data/test/testcases/span/05_html/xml.text +5 -0
- data/test/testcases_gfm/backticks_syntax.html +2 -2
- metadata +20 -2
@@ -1,7 +1,7 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
#
|
3
3
|
#--
|
4
|
-
# Copyright (C) 2009-
|
4
|
+
# Copyright (C) 2009-2016 Thomas Leitner <t_leitner@gmx.at>
|
5
5
|
#
|
6
6
|
# This file is part of kramdown which is licensed under the MIT.
|
7
7
|
#++
|
@@ -22,7 +22,7 @@ module Kramdown
|
|
22
22
|
element = (result.length == 2 ? :strong : :em)
|
23
23
|
type = result[0..0]
|
24
24
|
|
25
|
-
if (type == '_' && @src.pre_match =~ /[[
|
25
|
+
if (type == '_' && @src.pre_match =~ /[^\s\[*_"']\z/) || @src.check(/\s/) ||
|
26
26
|
@tree.type == element || @stack.any? {|el, _| el.type == element}
|
27
27
|
add_text(result)
|
28
28
|
return
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
#
|
3
3
|
#--
|
4
|
-
# Copyright (C) 2009-
|
4
|
+
# Copyright (C) 2009-2016 Thomas Leitner <t_leitner@gmx.at>
|
5
5
|
#
|
6
6
|
# This file is part of kramdown which is licensed under the MIT.
|
7
7
|
#++
|
@@ -113,14 +113,15 @@ module Kramdown
|
|
113
113
|
warning("Found invalidly used HTML closing tag for '#{@src[1]}' on line #{line}")
|
114
114
|
add_text(result)
|
115
115
|
elsif result = @src.scan(HTML_TAG_RE)
|
116
|
-
tag_name = @src[1]
|
116
|
+
tag_name = @src[1]
|
117
|
+
tag_name.downcase! if HTML_ELEMENT[tag_name.downcase]
|
117
118
|
if HTML_BLOCK_ELEMENTS.include?(tag_name)
|
118
119
|
warning("Found block HTML tag '#{tag_name}' in span-level text on line #{line}")
|
119
120
|
add_text(result)
|
120
121
|
return
|
121
122
|
end
|
122
123
|
|
123
|
-
attrs = parse_html_attributes(@src[2], line)
|
124
|
+
attrs = parse_html_attributes(@src[2], line, HTML_ELEMENT[tag_name])
|
124
125
|
attrs.each {|name, value| value.gsub!(/\n+/, ' ')}
|
125
126
|
|
126
127
|
do_parsing = (HTML_CONTENT_MODEL[tag_name] == :raw || @tree.options[:content_model] == :raw ? false : @options[:parse_span_html])
|
@@ -139,7 +140,8 @@ module Kramdown
|
|
139
140
|
el = Element.new(:html_element, tag_name, attrs, :category => :span, :location => line,
|
140
141
|
:content_model => (do_parsing ? :span : :raw), :is_closed => !!@src[4])
|
141
142
|
@tree.children << el
|
142
|
-
stop_re = /<\/#{Regexp.escape(tag_name)}\s*>/
|
143
|
+
stop_re = /<\/#{Regexp.escape(tag_name)}\s*>/
|
144
|
+
stop_re = Regexp.new(stop_re.source, Regexp::IGNORECASE) if HTML_ELEMENT[tag_name]
|
143
145
|
if !@src[4] && !HTML_ELEMENTS_WITHOUT_BODY.include?(el.value)
|
144
146
|
if parse_spans(el, stop_re, (do_parsing ? nil : [:span_html]))
|
145
147
|
@src.scan(stop_re)
|
data/lib/kramdown/utils.rb
CHANGED
data/lib/kramdown/utils/html.rb
CHANGED
data/lib/kramdown/version.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
#
|
3
3
|
#--
|
4
|
-
# Copyright (C) 2009-
|
4
|
+
# Copyright (C) 2009-2016 Thomas Leitner <t_leitner@gmx.at>
|
5
5
|
#
|
6
6
|
# This file is part of kramdown which is licensed under the MIT.
|
7
7
|
#++
|
@@ -10,6 +10,6 @@
|
|
10
10
|
module Kramdown
|
11
11
|
|
12
12
|
# The kramdown version.
|
13
|
-
VERSION = '1.
|
13
|
+
VERSION = '1.11.0'
|
14
14
|
|
15
15
|
end
|
data/test/run_tests.rb
CHANGED
data/test/test_files.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
#
|
3
3
|
#--
|
4
|
-
# Copyright (C) 2009-
|
4
|
+
# Copyright (C) 2009-2016 Thomas Leitner <t_leitner@gmx.at>
|
5
5
|
#
|
6
6
|
# This file is part of kramdown which is licensed under the MIT.
|
7
7
|
#++
|
@@ -65,6 +65,8 @@ class TestFiles < Minitest::Test
|
|
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
67
|
'test/testcases/span/05_html/mark_element.html', # bc of tidy
|
68
|
+
'test/testcases/block/09_html/xml.html', # bc of tidy
|
69
|
+
'test/testcases/span/05_html/xml.html', # bc of tidy
|
68
70
|
].compact
|
69
71
|
EXCLUDE_HTML_TEXT_FILES = ['test/testcases/block/09_html/parse_as_span.htmlinput',
|
70
72
|
'test/testcases/block/09_html/parse_as_raw.htmlinput',
|
@@ -169,6 +171,8 @@ class TestFiles < Minitest::Test
|
|
169
171
|
'test/testcases/span/math/mathjaxnode.text', # bc of tidy
|
170
172
|
'test/testcases/span/01_link/link_defs_with_ial.text', # bc of attribute ordering
|
171
173
|
'test/testcases/span/05_html/mark_element.text', # bc of tidy
|
174
|
+
'test/testcases/block/09_html/xml.text', # bc of tidy
|
175
|
+
'test/testcases/span/05_html/xml.text', # bc of tidy
|
172
176
|
].compact
|
173
177
|
Dir[File.dirname(__FILE__) + '/testcases/**/*.text'].each do |text_file|
|
174
178
|
next if EXCLUDE_TEXT_FILES.any? {|f| text_file =~ /#{f}$/}
|
@@ -219,6 +223,8 @@ class TestFiles < Minitest::Test
|
|
219
223
|
'test/testcases/block/15_math/mathjax_preview_simple.html', # bc of mathjax preview
|
220
224
|
'test/testcases/span/01_link/link_defs_with_ial.html', # bc of attribute ordering
|
221
225
|
'test/testcases/span/05_html/mark_element.html', # bc of tidy
|
226
|
+
'test/testcases/block/09_html/xml.html', # bc of tidy
|
227
|
+
'test/testcases/span/05_html/xml.html', # bc of tidy
|
222
228
|
].compact
|
223
229
|
Dir[File.dirname(__FILE__) + '/testcases/**/*.{html,html.19}'].each do |html_file|
|
224
230
|
next if EXCLUDE_HTML_KD_FILES.any? {|f| html_file =~ /#{f}(\.19)?$/}
|
data/test/test_location.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
<div class="highlighter-coderay"><span class="CodeRay">x = <span class="constant">Class</span>.new
|
1
|
+
<div class="language-ruby highlighter-coderay"><span class="CodeRay">x = <span class="constant">Class</span>.new
|
2
2
|
</span>
|
3
3
|
</div>
|
4
|
-
<div class="highlighter-coderay"><span class="CodeRay"><span class="tag"><a></span>href<span class="tag"></a></span>
|
4
|
+
<div class="language-html highlighter-coderay"><span class="CodeRay"><span class="tag"><a></span>href<span class="tag"></a></span>
|
5
5
|
</span>
|
6
6
|
</div>
|