kramdown 0.10.0 → 0.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.
- data/CONTRIBUTERS +1 -1
- data/ChangeLog +594 -0
- data/Rakefile +2 -2
- data/VERSION +1 -1
- data/data/kramdown/document.html +11 -2
- data/doc/default.template +2 -2
- data/doc/index.page +1 -2
- data/doc/quickref.page +2 -2
- data/doc/syntax.page +270 -179
- data/lib/kramdown/converter/html.rb +43 -29
- data/lib/kramdown/converter/kramdown.rb +97 -73
- data/lib/kramdown/converter/latex.rb +18 -13
- data/lib/kramdown/document.rb +8 -6
- data/lib/kramdown/options.rb +7 -10
- data/lib/kramdown/parser/html.rb +29 -21
- data/lib/kramdown/parser/kramdown.rb +19 -3
- data/lib/kramdown/parser/kramdown/abbreviation.rb +1 -0
- data/lib/kramdown/parser/kramdown/attribute_list.rb +18 -12
- data/lib/kramdown/parser/kramdown/autolink.rb +1 -1
- data/lib/kramdown/parser/kramdown/block_boundary.rb +46 -0
- data/lib/kramdown/parser/kramdown/blockquote.rb +7 -3
- data/lib/kramdown/parser/kramdown/codeblock.rb +5 -3
- data/lib/kramdown/parser/kramdown/escaped_chars.rb +1 -1
- data/lib/kramdown/parser/kramdown/extension.rb +22 -8
- data/lib/kramdown/parser/kramdown/footnote.rb +3 -2
- data/lib/kramdown/parser/kramdown/header.rb +10 -10
- data/lib/kramdown/parser/kramdown/html.rb +16 -14
- data/lib/kramdown/parser/kramdown/html_entity.rb +1 -1
- data/lib/kramdown/parser/kramdown/link.rb +8 -8
- data/lib/kramdown/parser/kramdown/list.rb +36 -29
- data/lib/kramdown/parser/kramdown/math.rb +15 -4
- data/lib/kramdown/parser/kramdown/paragraph.rb +14 -3
- data/lib/kramdown/parser/kramdown/table.rb +17 -9
- data/lib/kramdown/utils.rb +1 -0
- data/lib/kramdown/utils/html.rb +9 -9
- data/lib/kramdown/utils/ordered_hash.rb +79 -0
- data/lib/kramdown/version.rb +1 -1
- data/man/man1/kramdown.1 +9 -12
- data/test/test_files.rb +6 -1
- data/test/testcases/block/02_eob/middle.html +0 -1
- data/test/testcases/block/04_header/atx_header.html +5 -2
- data/test/testcases/block/04_header/atx_header.text +3 -1
- data/test/testcases/block/04_header/setext_header.html +4 -5
- data/test/testcases/block/04_header/setext_header.html.19 +30 -0
- data/test/testcases/block/05_blockquote/lazy.html +34 -0
- data/test/testcases/block/05_blockquote/lazy.text +20 -0
- data/test/testcases/block/05_blockquote/nested.html +1 -0
- data/test/testcases/block/05_blockquote/nested.text +1 -0
- data/test/testcases/block/05_blockquote/with_code_blocks.html +2 -2
- data/test/testcases/block/06_codeblock/lazy.html +4 -0
- data/test/testcases/block/06_codeblock/lazy.text +5 -0
- data/test/testcases/block/06_codeblock/no_newline_at_end_1.html +2 -0
- data/test/testcases/block/06_codeblock/no_newline_at_end_1.text +2 -0
- data/test/testcases/block/06_codeblock/with_ial.html +6 -0
- data/test/testcases/block/06_codeblock/with_ial.text +5 -0
- data/test/testcases/block/07_horizontal_rule/normal.html +0 -2
- data/test/testcases/block/07_horizontal_rule/normal.text +0 -2
- data/test/testcases/block/08_list/item_ial.html +1 -3
- data/test/testcases/block/08_list/lazy.html +39 -0
- data/test/testcases/block/08_list/lazy.text +29 -0
- data/test/testcases/block/08_list/list_and_others.html +5 -3
- data/test/testcases/block/08_list/list_and_others.text +1 -0
- data/test/testcases/block/08_list/other_first_element.html +2 -2
- data/test/testcases/block/08_list/other_first_element.text +1 -1
- data/test/testcases/block/08_list/simple_ul.html +0 -13
- data/test/testcases/block/08_list/simple_ul.text +0 -7
- data/test/testcases/block/08_list/special_cases.html +8 -31
- data/test/testcases/block/08_list/special_cases.text +2 -15
- data/test/testcases/block/09_html/comment.html +2 -2
- data/test/testcases/block/09_html/html_to_native/emphasis.html +2 -0
- data/test/testcases/block/09_html/html_to_native/emphasis.text +2 -0
- data/test/testcases/block/09_html/html_to_native/table_normal.html +2 -1
- data/test/testcases/block/09_html/html_to_native/table_simple.html +4 -2
- data/test/testcases/block/09_html/invalid_html_1.html +2 -0
- data/test/testcases/block/09_html/parse_as_raw.html +2 -2
- data/test/testcases/block/09_html/parse_as_span.html +1 -1
- data/test/testcases/block/09_html/simple.html +2 -0
- data/test/testcases/block/09_html/simple.html.19 +2 -0
- data/test/testcases/block/09_html/simple.text +2 -0
- data/test/testcases/block/11_ial/auto_id_and_ial.html +1 -1
- data/test/testcases/block/11_ial/simple.html +2 -3
- data/test/testcases/block/12_extension/comment.html +3 -1
- data/test/testcases/block/12_extension/comment.text +2 -1
- data/test/testcases/block/12_extension/ignored.html +5 -1
- data/test/testcases/block/12_extension/ignored.text +1 -1
- data/test/testcases/block/12_extension/nomarkdown.html +5 -1
- data/test/testcases/block/12_extension/nomarkdown.kramdown +20 -0
- data/test/testcases/block/12_extension/nomarkdown.latex +13 -0
- data/test/testcases/block/12_extension/nomarkdown.text +11 -1
- data/test/testcases/block/13_definition_list/item_ial.html +1 -3
- data/test/testcases/block/13_definition_list/item_ial.text +1 -1
- data/test/testcases/block/13_definition_list/simple.html +2 -2
- data/test/testcases/block/14_table/errors.html +5 -0
- data/test/testcases/block/14_table/errors.text +6 -0
- data/test/testcases/block/14_table/header.text +1 -1
- data/test/testcases/block/14_table/no_table.text +1 -1
- data/test/testcases/block/14_table/simple.html +78 -0
- data/test/testcases/block/14_table/simple.text +22 -0
- data/test/testcases/block/15_math/normal.html +11 -4
- data/test/testcases/block/15_math/normal.text +10 -0
- data/test/testcases/encoding.html +1 -1
- data/test/testcases/span/01_link/image_in_a.html +3 -3
- data/test/testcases/span/01_link/imagelinks.html +7 -7
- data/test/testcases/span/01_link/inline.html +11 -5
- data/test/testcases/span/01_link/inline.html.19 +11 -5
- data/test/testcases/span/01_link/inline.text +11 -5
- data/test/testcases/span/01_link/link_defs.html +2 -1
- data/test/testcases/span/01_link/link_defs.text +4 -0
- data/test/testcases/span/01_link/reference.html +3 -0
- data/test/testcases/span/01_link/reference.html.19 +3 -0
- data/test/testcases/span/01_link/reference.text +5 -0
- data/test/testcases/span/03_codespan/highlighting.html +1 -0
- data/test/testcases/span/03_codespan/highlighting.text +1 -0
- data/test/testcases/span/04_footnote/definitions.html +3 -0
- data/test/testcases/span/04_footnote/definitions.latex +3 -4
- data/test/testcases/span/04_footnote/definitions.text +6 -0
- data/test/testcases/span/04_footnote/footnote_nr.latex +1 -5
- data/test/testcases/span/04_footnote/markers.latex +5 -14
- data/test/testcases/span/05_html/markdown_attr.html +1 -1
- data/test/testcases/span/05_html/markdown_attr.text +1 -1
- data/test/testcases/span/05_html/normal.html +5 -3
- data/test/testcases/span/05_html/normal.text +2 -0
- data/test/testcases/span/escaped_chars/normal.html +2 -0
- data/test/testcases/span/escaped_chars/normal.text +2 -0
- data/test/testcases/span/extension/comment.html +2 -2
- data/test/testcases/span/extension/ignored.html +1 -1
- data/test/testcases/span/text_substitutions/typography.html +1 -1
- data/test/testcases/span/text_substitutions/typography.html.19 +1 -1
- data/test/testcases/span/text_substitutions/typography.text +1 -1
- metadata +20 -5
- data/test/testcases/block/05_blockquote/only_first_quoted.html +0 -8
- data/test/testcases/block/05_blockquote/only_first_quoted.text +0 -4
@@ -20,6 +20,8 @@
|
|
20
20
|
#++
|
21
21
|
#
|
22
22
|
|
23
|
+
require 'kramdown/parser/kramdown/block_boundary'
|
24
|
+
|
23
25
|
module Kramdown
|
24
26
|
module Parser
|
25
27
|
class Kramdown
|
@@ -28,13 +30,22 @@ module Kramdown
|
|
28
30
|
|
29
31
|
# Parse the math block at the current location.
|
30
32
|
def parse_block_math
|
31
|
-
if
|
33
|
+
if !after_block_boundary?
|
34
|
+
return false
|
35
|
+
elsif @src[1]
|
32
36
|
@src.scan(/^#{OPT_SPACE}\\/)
|
33
37
|
return false
|
34
38
|
end
|
39
|
+
orig_pos = @src.pos
|
35
40
|
@src.pos += @src.matched_size
|
36
|
-
|
37
|
-
|
41
|
+
data = @src[2]
|
42
|
+
if before_block_boundary?
|
43
|
+
@tree.children << new_block_el(:math, data)
|
44
|
+
true
|
45
|
+
else
|
46
|
+
@src.pos = orig_pos
|
47
|
+
false
|
48
|
+
end
|
38
49
|
end
|
39
50
|
define_parser(:block_math, BLOCK_MATH_START)
|
40
51
|
|
@@ -44,7 +55,7 @@ module Kramdown
|
|
44
55
|
# Parse the inline math at the current location.
|
45
56
|
def parse_inline_math
|
46
57
|
@src.pos += @src.matched_size
|
47
|
-
@tree.children << Element.new(:math, @src[1], :category => :span)
|
58
|
+
@tree.children << Element.new(:math, @src[1], nil, :category => :span)
|
48
59
|
end
|
49
60
|
define_parser(:inline_math, INLINE_MATH_START, '\$')
|
50
61
|
|
@@ -20,20 +20,31 @@
|
|
20
20
|
#++
|
21
21
|
#
|
22
22
|
|
23
|
+
require 'kramdown/parser/kramdown/blank_line'
|
24
|
+
require 'kramdown/parser/kramdown/attribute_list'
|
25
|
+
require 'kramdown/parser/kramdown/eob'
|
26
|
+
require 'kramdown/parser/kramdown/list'
|
27
|
+
require 'kramdown/parser/kramdown/html'
|
28
|
+
|
23
29
|
module Kramdown
|
24
30
|
module Parser
|
25
31
|
class Kramdown
|
26
32
|
|
33
|
+
LAZY_END_HTML_SPAN_ELEMENTS = HTML_SPAN_ELEMENTS + %w{script}
|
34
|
+
LAZY_END_HTML_START = /<(?>(?!(?:#{LAZY_END_HTML_SPAN_ELEMENTS.join('|')})\b)#{REXML::Parsers::BaseParser::UNAME_STR})\s*(?>\s+#{REXML::Parsers::BaseParser::UNAME_STR}\s*=\s*(["']).*?\1)*\s*\/?>/m
|
35
|
+
LAZY_END_HTML_STOP = /<\/(?!(?:#{LAZY_END_HTML_SPAN_ELEMENTS.join('|')})\b)#{REXML::Parsers::BaseParser::UNAME_STR}\s*>/m
|
36
|
+
|
27
37
|
PARAGRAPH_START = /^#{OPT_SPACE}[^ \t].*?\n/
|
38
|
+
PARAGRAPH_MATCH = /(?:^.*\n)+?(?=#{BLANK_LINE}|#{IAL_BLOCK_START}|#{EOB_MARKER}|#{DEFINITION_LIST_START}|^#{OPT_SPACE}#{LAZY_END_HTML_STOP}|^#{OPT_SPACE}#{LAZY_END_HTML_START}|\Z)/
|
28
39
|
|
29
40
|
# Parse the paragraph at the current location.
|
30
41
|
def parse_paragraph
|
31
|
-
|
42
|
+
result = @src.scan(PARAGRAPH_MATCH)
|
32
43
|
if @tree.children.last && @tree.children.last.type == :p
|
33
|
-
@tree.children.last.children.first.value << "\n" <<
|
44
|
+
@tree.children.last.children.first.value << "\n" << result.chomp
|
34
45
|
else
|
35
46
|
@tree.children << new_block_el(:p)
|
36
|
-
|
47
|
+
@tree.children.last.children << Element.new(@text_type, result.lstrip.chomp)
|
37
48
|
end
|
38
49
|
true
|
39
50
|
end
|
@@ -20,25 +20,26 @@
|
|
20
20
|
#++
|
21
21
|
#
|
22
22
|
|
23
|
-
require 'kramdown/parser/kramdown/
|
24
|
-
require 'kramdown/parser/kramdown/eob'
|
25
|
-
require 'kramdown/parser/kramdown/horizontal_rule'
|
23
|
+
require 'kramdown/parser/kramdown/block_boundary'
|
26
24
|
|
27
25
|
module Kramdown
|
28
26
|
module Parser
|
29
27
|
class Kramdown
|
30
28
|
|
31
|
-
TABLE_SEP_LINE =
|
29
|
+
TABLE_SEP_LINE = /^([+|: -]*?-[+|: -]*?)[ \t]*\n/
|
32
30
|
TABLE_HSEP_ALIGN = /[ ]?(:?)-+(:?)[ ]?/
|
33
|
-
TABLE_FSEP_LINE =
|
34
|
-
TABLE_ROW_LINE =
|
35
|
-
|
31
|
+
TABLE_FSEP_LINE = /^[+|: =]*?=[+|: =]*?[ \t]*\n/
|
32
|
+
TABLE_ROW_LINE = /^(.*?)[ \t]*\n/
|
33
|
+
TABLE_LINE = /(?:\||.*?[^\\\n]\|).*?\n/
|
34
|
+
TABLE_START = /^#{OPT_SPACE}(?=\S)#{TABLE_LINE}/
|
36
35
|
|
37
36
|
# Parse the table at the current location.
|
38
37
|
def parse_table
|
39
|
-
|
40
|
-
table = new_block_el(:table, nil, :alignment => [])
|
38
|
+
return false if !after_block_boundary?
|
41
39
|
|
40
|
+
orig_pos = @src.pos
|
41
|
+
table = new_block_el(:table, nil, nil, :alignment => [])
|
42
|
+
leading_pipe = (@src.check(TABLE_LINE) =~ /^\s*\|/)
|
42
43
|
@src.scan(TABLE_SEP_LINE)
|
43
44
|
|
44
45
|
rows = []
|
@@ -54,6 +55,7 @@ module Kramdown
|
|
54
55
|
end
|
55
56
|
|
56
57
|
while !@src.eos?
|
58
|
+
break if !@src.check(TABLE_LINE)
|
57
59
|
if @src.scan(TABLE_SEP_LINE) && !rows.empty?
|
58
60
|
if table.options[:alignment].empty? && !has_footer
|
59
61
|
add_container.call(:thead, false)
|
@@ -79,6 +81,7 @@ module Kramdown
|
|
79
81
|
i += 1
|
80
82
|
end
|
81
83
|
end
|
84
|
+
cells.shift if leading_pipe && cells.first.strip.empty?
|
82
85
|
cells.pop if cells.last.strip.empty?
|
83
86
|
cells.each do |cell_text|
|
84
87
|
tcell = Element.new(:td)
|
@@ -92,6 +95,11 @@ module Kramdown
|
|
92
95
|
end
|
93
96
|
end
|
94
97
|
|
98
|
+
if !before_block_boundary?
|
99
|
+
@src.pos = orig_pos
|
100
|
+
return false
|
101
|
+
end
|
102
|
+
|
95
103
|
add_container.call(has_footer ? :tfoot : :tbody, false) if !rows.empty?
|
96
104
|
|
97
105
|
if !table.children.any? {|c| c.type == :tbody}
|
data/lib/kramdown/utils.rb
CHANGED
data/lib/kramdown/utils/html.rb
CHANGED
@@ -42,7 +42,7 @@ module Kramdown
|
|
42
42
|
|
43
43
|
# Return the string with the attributes of the element +el+.
|
44
44
|
def html_attributes(el)
|
45
|
-
|
45
|
+
el.attr.map {|k,v| v.nil? ? '' : " #{k}=\"#{escape_html(v.to_s, :attribute)}\"" }.join('')
|
46
46
|
end
|
47
47
|
|
48
48
|
ESCAPE_MAP = {
|
@@ -51,19 +51,19 @@ module Kramdown
|
|
51
51
|
'&' => '&',
|
52
52
|
'"' => '"'
|
53
53
|
}
|
54
|
-
ESCAPE_ALL_RE =
|
55
|
-
|
56
|
-
|
54
|
+
ESCAPE_ALL_RE = /<|>|&/
|
55
|
+
ESCAPE_TEXT_RE = Regexp.union(REXML::Parsers::BaseParser::REFERENCE_RE, /<|>|&/)
|
56
|
+
ESCAPE_ATTRIBUTE_RE = Regexp.union(REXML::Parsers::BaseParser::REFERENCE_RE, /<|>|&|"/)
|
57
57
|
ESCAPE_RE_FROM_TYPE = {
|
58
58
|
:all => ESCAPE_ALL_RE,
|
59
|
-
:
|
60
|
-
:
|
59
|
+
:text => ESCAPE_TEXT_RE,
|
60
|
+
:attribute => ESCAPE_ATTRIBUTE_RE
|
61
61
|
}
|
62
62
|
|
63
63
|
# Escape the special HTML characters in the string +str+. The parameter +type+ specifies what
|
64
|
-
# is escaped: <tt>:all</tt> - all special HTML characters as well as entities,
|
65
|
-
#
|
66
|
-
# special HTML characters
|
64
|
+
# is escaped: <tt>:all</tt> - all special HTML characters as well as entities, <tt>:text</tt>
|
65
|
+
# - all special HTML characters except the quotation mark but no entities and
|
66
|
+
# <tt>:attribute</tt> - all special HTML characters including the quotation mark but no entities.
|
67
67
|
def escape_html(str, type = :all)
|
68
68
|
str.gsub(ESCAPE_RE_FROM_TYPE[type]) {|m| ESCAPE_MAP[m] || m}
|
69
69
|
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
#
|
3
|
+
#--
|
4
|
+
# Copyright (C) 2009-2010 Thomas Leitner <t_leitner@gmx.at>
|
5
|
+
#
|
6
|
+
# This file is part of kramdown.
|
7
|
+
#
|
8
|
+
# kramdown is free software: you can redistribute it and/or modify
|
9
|
+
# it under the terms of the GNU General Public License as published by
|
10
|
+
# the Free Software Foundation, either version 3 of the License, or
|
11
|
+
# (at your option) any later version.
|
12
|
+
#
|
13
|
+
# This program is distributed in the hope that it will be useful,
|
14
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16
|
+
# GNU General Public License for more details.
|
17
|
+
#
|
18
|
+
# You should have received a copy of the GNU General Public License
|
19
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
20
|
+
#++
|
21
|
+
#
|
22
|
+
|
23
|
+
module Kramdown
|
24
|
+
|
25
|
+
module Utils
|
26
|
+
|
27
|
+
# A very simple class mimicking the most used methods of a Hash. The difference to a normal Hash
|
28
|
+
# is that a OrderedHash retains the insertion order of the keys.
|
29
|
+
class OrderedHash
|
30
|
+
|
31
|
+
include Enumerable
|
32
|
+
|
33
|
+
# Direct access to the hash with the key-value pairs. May not be used to modify the data!
|
34
|
+
attr_reader :data
|
35
|
+
|
36
|
+
# Initialize the OrderedHash object, optionally with an +hash+. If the optional +hash+ is
|
37
|
+
# used, there is no special order imposed on the keys (additionally set keys will be stored in
|
38
|
+
# insertion order). An OrderedHash object may be used instead of a hash to provide the initial
|
39
|
+
# data.
|
40
|
+
def initialize(hash = {})
|
41
|
+
if hash.kind_of?(OrderedHash)
|
42
|
+
@data, @order = hash.instance_eval { [@data.dup, @order.dup] }
|
43
|
+
else
|
44
|
+
@data = hash || {}
|
45
|
+
@order = @data.keys
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
# Iterate over the stored keys in insertion order.
|
50
|
+
def each
|
51
|
+
@order.each {|k| yield(k, @data[k])}
|
52
|
+
end
|
53
|
+
|
54
|
+
# Return the value for the +key+.
|
55
|
+
def [](key)
|
56
|
+
@data[key]
|
57
|
+
end
|
58
|
+
|
59
|
+
# Set the value for the +key+ to +val+.
|
60
|
+
def []=(key, val)
|
61
|
+
@order << key if !@data.has_key?(key)
|
62
|
+
@data[key] = val
|
63
|
+
end
|
64
|
+
|
65
|
+
# Delete the +key+.
|
66
|
+
def delete(key)
|
67
|
+
@order.delete(key)
|
68
|
+
@data.delete(key)
|
69
|
+
end
|
70
|
+
|
71
|
+
def inspect #:nodoc:
|
72
|
+
"{" + map {|k,v| "#{k.inspect}=>#{v.inspect}"}.join(" ") + "}"
|
73
|
+
end
|
74
|
+
|
75
|
+
end
|
76
|
+
|
77
|
+
end
|
78
|
+
|
79
|
+
end
|
data/lib/kramdown/version.rb
CHANGED
data/man/man1/kramdown.1
CHANGED
@@ -199,18 +199,6 @@ Default: style
|
|
199
199
|
Used by: HTML converter
|
200
200
|
|
201
201
|
|
202
|
-
.TP
|
203
|
-
.B \-\-[no\-]numeric-entities
|
204
|
-
|
205
|
-
DEPRECATED: Defines whether entities are output using names or numeric values
|
206
|
-
|
207
|
-
Note that this option is deprecated and replaced by the entities option.
|
208
|
-
This option will be removed in a future release.
|
209
|
-
|
210
|
-
Default: false
|
211
|
-
Used by: HTML converter, kramdown converter
|
212
|
-
|
213
|
-
|
214
202
|
.TP
|
215
203
|
.B \-\-entity-output ARG
|
216
204
|
|
@@ -237,6 +225,15 @@ Default: 0
|
|
237
225
|
Used by: HTML/Latex converter
|
238
226
|
|
239
227
|
|
228
|
+
.TP
|
229
|
+
.B \-\-line-width ARG
|
230
|
+
|
231
|
+
Defines the line width to be used when outputting a document
|
232
|
+
|
233
|
+
Default: 72
|
234
|
+
Used by: kramdown converter
|
235
|
+
|
236
|
+
|
240
237
|
.SH EXIT STATUS
|
241
238
|
The exit status is 0 if no error happened. Otherwise it is 1.
|
242
239
|
.SH SEE ALSO
|
data/test/test_files.rb
CHANGED
@@ -53,7 +53,8 @@ class TestFiles < Test::Unit::TestCase
|
|
53
53
|
warn("Skipping html-to-html tests because tidy executable is missing")
|
54
54
|
else
|
55
55
|
EXCLUDE_HTML_FILES = ['test/testcases/block/06_codeblock/whitespace.html', # bc of span inside pre
|
56
|
-
'test/testcases/block/09_html/simple.html' # bc of xml elements
|
56
|
+
'test/testcases/block/09_html/simple.html', # bc of xml elements
|
57
|
+
'test/testcases/span/03_codespan/highlighting.html', # bc of span elements inside code element
|
57
58
|
]
|
58
59
|
Dir[File.dirname(__FILE__) + '/testcases/**/*.html'].each do |html_file|
|
59
60
|
next if EXCLUDE_HTML_FILES.any? {|f| html_file =~ /#{f}$/}
|
@@ -115,6 +116,8 @@ class TestFiles < Test::Unit::TestCase
|
|
115
116
|
'test/testcases/block/09_html/content_model/tables.text', # bc of parse_block_html option
|
116
117
|
'test/testcases/block/09_html/html_to_native/header.text', # bc of auto_ids option that interferes
|
117
118
|
'test/testcases/block/09_html/simple.text', # bc of webgen:block elements
|
119
|
+
'test/testcases/block/11_ial/simple.text', # bc of change of ordering of attributes in header
|
120
|
+
'test/testcases/span/extension/comment.text', # bc of comment text modifications (can this be avoided?)
|
118
121
|
]
|
119
122
|
Dir[File.dirname(__FILE__) + '/testcases/**/*.text'].each do |text_file|
|
120
123
|
next if EXCLUDE_TEXT_FILES.any? {|f| text_file =~ /#{f}$/}
|
@@ -143,6 +146,8 @@ class TestFiles < Test::Unit::TestCase
|
|
143
146
|
'test/testcases/block/09_html/markdown_attr.html', # bc of markdown attr
|
144
147
|
'test/testcases/block/09_html/html_to_native/table_simple.html', # bc of invalidly converted simple table
|
145
148
|
'test/testcases/block/06_codeblock/whitespace.html', # bc of entity to char conversion
|
149
|
+
'test/testcases/block/11_ial/simple.html', # bc of change of ordering of attributes in header
|
150
|
+
'test/testcases/span/03_codespan/highlighting.html', # bc of span elements inside code element
|
146
151
|
]
|
147
152
|
Dir[File.dirname(__FILE__) + '/testcases/**/*.html'].each do |html_file|
|
148
153
|
next if EXCLUDE_HTML_KD_FILES.any? {|f| html_file =~ /#{f}$/}
|
@@ -10,6 +10,9 @@
|
|
10
10
|
|
11
11
|
<h6>This is a header</h6>
|
12
12
|
|
13
|
+
<h1>Header</h1>
|
14
|
+
<h1>Header</h1>
|
15
|
+
|
13
16
|
<h2>Header</h2>
|
14
17
|
<blockquote>
|
15
18
|
<p>blockquote</p>
|
@@ -19,9 +22,9 @@
|
|
19
22
|
<p>paragraph</p>
|
20
23
|
|
21
24
|
<blockquote>
|
22
|
-
<p>blockquote
|
25
|
+
<p>blockquote
|
26
|
+
### not a header</p>
|
23
27
|
</blockquote>
|
24
|
-
<p>### not a header</p>
|
25
28
|
|
26
29
|
<h3 id="id">Header</h3>
|
27
30
|
|
@@ -5,9 +5,8 @@
|
|
5
5
|
<h2>test</h2>
|
6
6
|
<p>para</p>
|
7
7
|
|
8
|
-
<pre><code> header
|
8
|
+
<pre><code> header =
|
9
9
|
</code></pre>
|
10
|
-
<p>=</p>
|
11
10
|
|
12
11
|
<p>=</p>
|
13
12
|
|
@@ -17,10 +16,10 @@ And not a header.
|
|
17
16
|
=================</p>
|
18
17
|
|
19
18
|
<blockquote>
|
20
|
-
<p>Blockquote
|
19
|
+
<p>Blockquote.
|
20
|
+
Not a Header
|
21
|
+
—</p>
|
21
22
|
</blockquote>
|
22
|
-
<p>Not a Header</p>
|
23
|
-
<hr />
|
24
23
|
|
25
24
|
<h2 id="id">header</h2>
|
26
25
|
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<h2>test</h2>
|
2
|
+
|
3
|
+
<h1>test2</h1>
|
4
|
+
|
5
|
+
<h2>test</h2>
|
6
|
+
<p>para</p>
|
7
|
+
|
8
|
+
<pre><code> header =
|
9
|
+
</code></pre>
|
10
|
+
|
11
|
+
<p>=</p>
|
12
|
+
|
13
|
+
<p>This is a para.
|
14
|
+
With two lines.
|
15
|
+
And not a header.
|
16
|
+
=================</p>
|
17
|
+
|
18
|
+
<blockquote>
|
19
|
+
<p>Blockquote.
|
20
|
+
Not a Header
|
21
|
+
—</p>
|
22
|
+
</blockquote>
|
23
|
+
|
24
|
+
<h2 id="id">header</h2>
|
25
|
+
|
26
|
+
<h1 id="id">header</h1>
|
27
|
+
|
28
|
+
<h2>header{#noid}</h2>
|
29
|
+
|
30
|
+
<h2>header</h2>
|
@@ -0,0 +1,34 @@
|
|
1
|
+
<blockquote>
|
2
|
+
<p>This is a long
|
3
|
+
long line.</p>
|
4
|
+
</blockquote>
|
5
|
+
|
6
|
+
<blockquote>
|
7
|
+
<blockquote>
|
8
|
+
<p>Nested quote
|
9
|
+
inside
|
10
|
+
still inside</p>
|
11
|
+
</blockquote>
|
12
|
+
</blockquote>
|
13
|
+
|
14
|
+
<blockquote>
|
15
|
+
<blockquote>
|
16
|
+
<p>This is a subquote.
|
17
|
+
over multipline lines.
|
18
|
+
continuing
|
19
|
+
here</p>
|
20
|
+
</blockquote>
|
21
|
+
</blockquote>
|
22
|
+
|
23
|
+
<blockquote>
|
24
|
+
<p>This is a quote
|
25
|
+
no code</p>
|
26
|
+
</blockquote>
|
27
|
+
|
28
|
+
<blockquote id="id">
|
29
|
+
<p>This is a quote</p>
|
30
|
+
</blockquote>
|
31
|
+
|
32
|
+
<blockquote>
|
33
|
+
<p>This is a quote</p>
|
34
|
+
</blockquote>
|