motion-kramdown 0.6.0 → 1.16.2
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 +5 -5
- data/README.md +6 -2
- data/lib/kramdown.rb +1 -1
- data/lib/kramdown/converter.rb +10 -11
- data/lib/kramdown/converter/base.rb +19 -12
- data/lib/kramdown/converter/hash_ast.rb +38 -0
- data/lib/kramdown/converter/html.rb +71 -39
- data/lib/kramdown/converter/kramdown.rb +19 -10
- data/lib/kramdown/converter/latex.rb +28 -10
- data/lib/kramdown/converter/man.rb +303 -0
- data/lib/kramdown/converter/math_engine/itex2mml.rb +2 -2
- data/lib/kramdown/converter/math_engine/mathjax.rb +13 -3
- data/lib/kramdown/converter/math_engine/mathjaxnode.rb +56 -0
- data/lib/kramdown/converter/math_engine/ritex.rb +2 -2
- data/lib/kramdown/converter/math_engine/sskatex.rb +97 -0
- data/lib/kramdown/converter/pdf.rb +6 -6
- data/lib/kramdown/converter/remove_html_tags.rb +5 -3
- data/lib/kramdown/converter/syntax_highlighter.rb +5 -2
- data/lib/kramdown/converter/syntax_highlighter/coderay.rb +8 -5
- data/lib/kramdown/converter/syntax_highlighter/minted.rb +35 -0
- data/lib/kramdown/converter/syntax_highlighter/rouge.rb +48 -10
- data/lib/kramdown/converter/toc.rb +2 -2
- data/lib/kramdown/document.rb +16 -19
- data/lib/kramdown/element.rb +5 -1
- data/lib/kramdown/error.rb +1 -1
- data/lib/kramdown/options.rb +103 -7
- data/lib/kramdown/parser.rb +1 -1
- data/lib/kramdown/parser/base.rb +12 -18
- data/lib/kramdown/parser/gfm.rb +142 -11
- data/lib/kramdown/parser/html.rb +28 -18
- data/lib/kramdown/parser/kramdown.rb +45 -36
- data/lib/kramdown/parser/kramdown/abbreviation.rb +1 -1
- data/lib/kramdown/parser/kramdown/autolink.rb +2 -8
- data/lib/kramdown/parser/kramdown/blank_line.rb +2 -2
- data/lib/kramdown/parser/kramdown/block_boundary.rb +4 -4
- data/lib/kramdown/parser/kramdown/blockquote.rb +4 -4
- data/lib/kramdown/parser/kramdown/codeblock.rb +11 -8
- 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 +6 -3
- data/lib/kramdown/parser/kramdown/footnote.rb +4 -5
- data/lib/kramdown/parser/kramdown/header.rb +2 -2
- data/lib/kramdown/parser/kramdown/horizontal_rule.rb +1 -1
- data/lib/kramdown/parser/kramdown/html.rb +8 -8
- data/lib/kramdown/parser/kramdown/html_entity.rb +2 -2
- data/lib/kramdown/parser/kramdown/line_break.rb +1 -1
- data/lib/kramdown/parser/kramdown/link.rb +5 -4
- data/lib/kramdown/parser/kramdown/list.rb +17 -10
- data/lib/kramdown/parser/kramdown/math.rb +2 -2
- data/lib/kramdown/parser/kramdown/paragraph.rb +19 -8
- data/lib/kramdown/parser/kramdown/smart_quotes.rb +3 -3
- data/lib/kramdown/parser/kramdown/table.rb +10 -12
- data/lib/kramdown/parser/kramdown/typographic_symbol.rb +1 -1
- data/lib/kramdown/parser/markdown.rb +2 -2
- data/lib/kramdown/utils.rb +2 -1
- data/lib/kramdown/utils/configurable.rb +2 -2
- data/lib/kramdown/utils/entities.rb +1 -1
- data/lib/kramdown/utils/html.rb +2 -2
- data/lib/kramdown/utils/lru_cache.rb +40 -0
- data/lib/kramdown/utils/ordered_hash.rb +2 -71
- data/lib/kramdown/utils/string_scanner.rb +2 -2
- data/lib/kramdown/utils/unidecoder.rb +2 -2
- data/lib/kramdown/version.rb +2 -2
- data/lib/rubymotion/require_override.rb +9 -0
- data/lib/rubymotion/version.rb +1 -1
- data/spec/{helpers → motion-kramdown/_helpers}/it_behaves_like.rb +0 -0
- data/spec/{helpers → motion-kramdown/_helpers}/option_file.rb +2 -2
- data/spec/{helpers → motion-kramdown/_helpers}/tidy.rb +0 -0
- data/spec/motion-kramdown/bench_mark.rb +37 -0
- data/spec/{document_tree.rb → motion-kramdown/document_tree.rb} +11 -1
- data/spec/{gfm_to_html.rb → motion-kramdown/gfm_to_html.rb} +51 -18
- data/spec/{html_to_html.rb → motion-kramdown/html_to_html.rb} +27 -9
- data/spec/{html_to_kramdown_to_html.rb → motion-kramdown/html_to_kramdown_to_html.rb} +35 -16
- data/spec/motion-kramdown/kramdown_to_xxx.rb +75 -0
- data/spec/{test_location.rb → motion-kramdown/test_location.rb} +0 -0
- data/spec/{test_string_scanner_kramdown.rb → motion-kramdown/test_string_scanner_kramdown.rb} +0 -0
- data/spec/motion-kramdown/text_manpage.rb +11 -0
- data/spec/{text_to_kramdown_to_html.rb → motion-kramdown/text_to_kramdown_to_html.rb} +30 -19
- data/spec/{text_to_latex.rb → motion-kramdown/text_to_latex.rb} +0 -0
- data/spec/{helpers/spec_options.rb → spec_helper.rb} +13 -2
- metadata +54 -33
- data/lib/kramdown/compatibility.rb +0 -36
- data/spec/bench_mark.rb +0 -43
- data/spec/kramdown_to_xxx.rb +0 -42
data/lib/kramdown/utils/html.rb
CHANGED
@@ -1,13 +1,13 @@
|
|
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
|
#++
|
8
8
|
#
|
9
9
|
|
10
|
-
|
10
|
+
require 'rexml/parsers/baseparser'
|
11
11
|
|
12
12
|
module Kramdown
|
13
13
|
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
#
|
3
|
+
#--
|
4
|
+
# Copyright (C) 2014-2017 Thomas Leitner <t_leitner@gmx.at>
|
5
|
+
#
|
6
|
+
# This file is part of kramdown which is licensed under the MIT.
|
7
|
+
#++
|
8
|
+
|
9
|
+
module Kramdown
|
10
|
+
module Utils
|
11
|
+
|
12
|
+
# A simple least recently used (LRU) cache.
|
13
|
+
#
|
14
|
+
# The cache relies on the fact that Ruby's Hash class maintains insertion order. So deleting
|
15
|
+
# and re-inserting a key-value pair on access moves the key to the last position. When an
|
16
|
+
# entry is added and the cache is full, the first entry is removed.
|
17
|
+
class LRUCache
|
18
|
+
|
19
|
+
# Creates a new LRUCache that can hold +size+ entries.
|
20
|
+
def initialize(size)
|
21
|
+
@size = size
|
22
|
+
@cache = {}
|
23
|
+
end
|
24
|
+
|
25
|
+
# Returns the stored value for +key+ or +nil+ if no value was stored under the key.
|
26
|
+
def [](key)
|
27
|
+
(val = @cache.delete(key)).nil? ? nil : @cache[key] = val
|
28
|
+
end
|
29
|
+
|
30
|
+
# Stores the +value+ under the +key+.
|
31
|
+
def []=(key, value)
|
32
|
+
@cache.delete(key)
|
33
|
+
@cache[key] = value
|
34
|
+
@cache.shift if @cache.length > @size
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
40
|
+
end
|
@@ -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
|
#++
|
@@ -11,76 +11,7 @@ module Kramdown
|
|
11
11
|
|
12
12
|
module Utils
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
# A partial hash implementation which preserves the insertion order of the keys.
|
17
|
-
#
|
18
|
-
# *Note* that this class is only used on Ruby 1.8 since the built-in Hash on Ruby 1.9
|
19
|
-
# automatically preserves the insertion order. However, to remain compatibility only the
|
20
|
-
# methods defined in this class may be used when working with OrderedHash on Ruby 1.9.
|
21
|
-
class OrderedHash
|
22
|
-
|
23
|
-
include Enumerable
|
24
|
-
|
25
|
-
# Initialize the OrderedHash object.
|
26
|
-
def initialize
|
27
|
-
@data = {}
|
28
|
-
@order = []
|
29
|
-
end
|
30
|
-
|
31
|
-
# Iterate over the stored keys in insertion order.
|
32
|
-
def each
|
33
|
-
@order.each {|k| yield(k, @data[k])}
|
34
|
-
end
|
35
|
-
|
36
|
-
# Return the value for the +key+.
|
37
|
-
def [](key)
|
38
|
-
@data[key]
|
39
|
-
end
|
40
|
-
|
41
|
-
# Return +true+ if the hash contains the key.
|
42
|
-
def has_key?(key)
|
43
|
-
@data.has_key?(key)
|
44
|
-
end
|
45
|
-
|
46
|
-
# Set the value for the +key+ to +val+.
|
47
|
-
def []=(key, val)
|
48
|
-
@order << key if !@data.has_key?(key)
|
49
|
-
@data[key] = val
|
50
|
-
end
|
51
|
-
|
52
|
-
# Delete the +key+.
|
53
|
-
def delete(key)
|
54
|
-
@order.delete(key)
|
55
|
-
@data.delete(key)
|
56
|
-
end
|
57
|
-
|
58
|
-
def merge!(other)
|
59
|
-
other.each {|k,v| self[k] = v}
|
60
|
-
self
|
61
|
-
end
|
62
|
-
|
63
|
-
def dup #:nodoc:
|
64
|
-
new_object = super
|
65
|
-
new_object.instance_variable_set(:@data, @data.dup)
|
66
|
-
new_object.instance_variable_set(:@order, @order.dup)
|
67
|
-
new_object
|
68
|
-
end
|
69
|
-
|
70
|
-
def ==(other) #:nodoc:
|
71
|
-
return false unless other.kind_of?(self.class)
|
72
|
-
@data == other.instance_variable_get(:@data) && @order == other.instance_variable_get(:@order)
|
73
|
-
end
|
74
|
-
|
75
|
-
def inspect #:nodoc:
|
76
|
-
"{" + map {|k,v| "#{k.inspect}=>#{v.inspect}"}.join(" ") + "}"
|
77
|
-
end
|
78
|
-
|
79
|
-
end
|
80
|
-
|
81
|
-
else
|
82
|
-
OrderedHash = Hash
|
83
|
-
end
|
14
|
+
OrderedHash = Hash
|
84
15
|
|
85
16
|
end
|
86
17
|
|
@@ -1,14 +1,14 @@
|
|
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
|
#++
|
8
8
|
#
|
9
9
|
|
10
10
|
|
11
|
-
|
11
|
+
require 'strscan'
|
12
12
|
|
13
13
|
module Kramdown
|
14
14
|
module Utils
|
@@ -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
|
#++
|
@@ -19,7 +19,7 @@ module Kramdown
|
|
19
19
|
# RM TODO path = $:.find {|dir| File.directory?(File.join(File.expand_path(dir), "stringex", "unidecoder_data"))}
|
20
20
|
path = 'lib' # RM TODO
|
21
21
|
|
22
|
-
if
|
22
|
+
if !path
|
23
23
|
def self.decode(string)
|
24
24
|
string
|
25
25
|
end
|
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.16.2'
|
14
14
|
|
15
15
|
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
module Kernel
|
2
|
+
# Since RubyMotion doesn't support `require` in the code, then let's
|
3
|
+
# noop it. This allows us to keep the original kramdown require statements
|
4
|
+
# so that the source is more pure and easier to diff.
|
5
|
+
# This _should_ be safe...
|
6
|
+
def require(_name)
|
7
|
+
# noop
|
8
|
+
end
|
9
|
+
end
|
data/lib/rubymotion/version.rb
CHANGED
File without changes
|
@@ -1,6 +1,6 @@
|
|
1
1
|
#------------------------------------------------------------------------------
|
2
2
|
def testcase_dir(dir = 'testcases')
|
3
|
-
File.join(File.dirname(__FILE__), '
|
3
|
+
File.join(File.dirname(__FILE__), '../../../test', dir)
|
4
4
|
end
|
5
5
|
|
6
6
|
#------------------------------------------------------------------------------
|
@@ -18,7 +18,7 @@ def load_options(opts_file)
|
|
18
18
|
options.tap do |o|
|
19
19
|
o.keys.each { |k| o[(k.to_s[0] == ':' ? k[1..-1] : k).to_sym] = o.delete(k) }
|
20
20
|
end
|
21
|
-
|
21
|
+
|
22
22
|
# YAML isn't hanldling integers correctly, is giving doubles instead
|
23
23
|
options[:header_offset] = options[:header_offset].to_int if options[:header_offset]
|
24
24
|
options[:footnote_nr] = options[:footnote_nr].to_int if options[:footnote_nr]
|
File without changes
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# runs = 10
|
2
|
+
# files = ['mdsyntax.text', 'mdbasics.text']
|
3
|
+
# benchmark_dir = File.join(File.dirname(__FILE__), '../../benchmark')
|
4
|
+
#
|
5
|
+
# puts
|
6
|
+
# puts "Running tests on #{Time.now.strftime("%Y-%m-%d")} under #{RUBY_DESCRIPTION}"
|
7
|
+
#
|
8
|
+
# files.each do |file|
|
9
|
+
# data = File.read(File.join(benchmark_dir, file))
|
10
|
+
# puts
|
11
|
+
# puts "==> Test using file #{file} and #{runs} runs"
|
12
|
+
#
|
13
|
+
# # results = Benchmark.bmbm do |b|
|
14
|
+
# results = Benchmark.bm do |b|
|
15
|
+
# b.report("kramdown #{Kramdown::VERSION}") { runs.times { Kramdown::Document.new(data).to_html } }
|
16
|
+
# # b.report(" hoedown 3.0.1") do
|
17
|
+
# # runs.times do
|
18
|
+
# # document = HoedownDocument.new
|
19
|
+
# # document.initWithHtmlRendererWithFlags(FLAGS)
|
20
|
+
# # html = document.renderMarkdownString(data)
|
21
|
+
# # end
|
22
|
+
# # end
|
23
|
+
# end
|
24
|
+
#
|
25
|
+
# # puts
|
26
|
+
# # puts "Real time of X divided by real time of kramdown"
|
27
|
+
# # kd = results.shift.real
|
28
|
+
# # %w[hoedown].each do |name|
|
29
|
+
# # puts name.ljust(19) << (results.shift.real/kd).round(4).to_s
|
30
|
+
# # end
|
31
|
+
# end
|
32
|
+
#
|
33
|
+
# describe "Benchmark Test" do
|
34
|
+
# it "benchmarks with mdsyntax.text and mdbasics.text" do
|
35
|
+
# expect(true).to eq true
|
36
|
+
# end
|
37
|
+
# end
|
@@ -15,16 +15,26 @@ describe "asserting that converters don't modify the document tree" do
|
|
15
15
|
'test/testcases/block/15_math/ritex.text', # bc no math support yet
|
16
16
|
'test/testcases/block/15_math/mathjax_preview.text', # bc no math support yet
|
17
17
|
'test/testcases/block/15_math/mathjax_preview_simple.text', # bc no math support yet
|
18
|
+
'test/testcases/block/15_math/mathjaxnode_notexhints.text', # bc no math support yet
|
19
|
+
'test/testcases/block/15_math/mathjaxnode_semantics.text', # bc no math support yet
|
20
|
+
'test/testcases/block/15_math/mathjaxnode.text', # bc no math support yet
|
21
|
+
'test/testcases/block/15_math/mathjax_preview_as_code.text', # bc no math support yet
|
22
|
+
'test/testcases/man/example.text', # bc no math support yet
|
23
|
+
'test/testcases/span/math/mathjaxnode.text', # bc no math support yet
|
18
24
|
'test/testcases/span/math/normal.text', # bc no math support yet
|
19
25
|
'test/testcases/span/math/ritex.text', # bc no math support yet
|
20
26
|
'test/testcases/span/math/itex2mml.text', # bc no math support yet
|
27
|
+
|
28
|
+
'test/testcases/block/15_math/sskatex.text', # bc no math support yet
|
29
|
+
'test/testcases/span/math/sskatex.text', # bc no math support yet
|
30
|
+
'test/testcases/span/04_footnote/backlink_inline.text', # bc no math support yet
|
21
31
|
].compact
|
22
32
|
|
23
33
|
Dir["#{focus_files(testcase_dir)}.text"].each do |text_file|
|
24
34
|
next if EXCLUDE_TREE_FILES.any? {|f| text_file =~ /#{f}$/}
|
25
35
|
opts_file = text_file.sub(/\.text$/, '.options')
|
26
36
|
options = load_options(opts_file)
|
27
|
-
|
37
|
+
|
28
38
|
(Kramdown::Converter.constants(true).map {|c| c.to_sym} - [:Latex, :Base, :RemoveHtmlTags, :MathEngine, :SyntaxHighlighter]).each do |conv_class|
|
29
39
|
next if conv_class == :Pdf && (RUBY_VERSION < '2.0' || EXCLUDE_PDF_MODIFY.any? {|f| text_file =~ /#{f}$/})
|
30
40
|
|
@@ -1,20 +1,42 @@
|
|
1
1
|
describe "gfm-to-html conversion" do
|
2
2
|
|
3
|
+
MATHJAX_NODE_AVAILABLE = begin
|
4
|
+
require 'kramdown/converter/math_engine/mathjaxnode'
|
5
|
+
Kramdown::Converter::MathEngine::MathjaxNode::AVAILABLE or
|
6
|
+
warn("Skipping MathjaxNode tests as MathjaxNode is not available")
|
7
|
+
end
|
8
|
+
|
9
|
+
KATEX_AVAILABLE = begin
|
10
|
+
/ class="katex"/ === Kramdown::Document.
|
11
|
+
new('$$a$$', {:math_engine => :sskatex}).to_html or
|
12
|
+
warn("Skipping SsKaTeX tests as SsKaTeX is not available.")
|
13
|
+
rescue
|
14
|
+
warn("Skipping SsKaTeX tests as default SsKaTeX config does not work.")
|
15
|
+
end or warn("Run \"rake dev:test_sskatex_deps\" to see why.")
|
16
|
+
|
3
17
|
EXCLUDE_GFM_FILES = [
|
4
18
|
'test/testcases/block/03_paragraph/no_newline_at_end.text',
|
5
19
|
'test/testcases/block/03_paragraph/indented.text',
|
6
20
|
'test/testcases/block/03_paragraph/two_para.text',
|
21
|
+
'test/testcases/block/03_paragraph/line_break_last_line.text',
|
7
22
|
'test/testcases/block/04_header/atx_header.text',
|
8
23
|
'test/testcases/block/04_header/setext_header.text',
|
24
|
+
'test/testcases/block/04_header/with_auto_ids.text', # bc of ID generation difference
|
25
|
+
'test/testcases/block/04_header/with_auto_id_prefix.text', # bc of ID generation difference
|
9
26
|
'test/testcases/block/05_blockquote/indented.text',
|
10
27
|
'test/testcases/block/05_blockquote/lazy.text',
|
11
28
|
'test/testcases/block/05_blockquote/nested.text',
|
12
29
|
'test/testcases/block/05_blockquote/no_newline_at_end.text',
|
13
30
|
'test/testcases/block/06_codeblock/error.text',
|
31
|
+
'test/testcases/block/06_codeblock/highlighting-opts.text', # bc no highlight support yet
|
32
|
+
'test/testcases/block/06_codeblock/highlighting.text', # bc no highlight support yet
|
33
|
+
('test/testcases/block/06_codeblock/rouge/simple.text' if RUBY_VERSION < '2.0'), #bc of rouge
|
34
|
+
('test/testcases/block/06_codeblock/rouge/multiple.text' if RUBY_VERSION < '2.0'), #bc of rouge
|
14
35
|
'test/testcases/block/07_horizontal_rule/error.text',
|
15
36
|
'test/testcases/block/08_list/escaping.text',
|
16
37
|
'test/testcases/block/08_list/item_ial.text',
|
17
38
|
'test/testcases/block/08_list/lazy.text',
|
39
|
+
'test/testcases/block/08_list/lazy_and_nested.text', # bc of change in lazy line handling
|
18
40
|
'test/testcases/block/08_list/list_and_others.text',
|
19
41
|
'test/testcases/block/08_list/other_first_element.text',
|
20
42
|
'test/testcases/block/08_list/simple_ul.text',
|
@@ -28,6 +50,7 @@ describe "gfm-to-html conversion" do
|
|
28
50
|
'test/testcases/block/12_extension/comment.text',
|
29
51
|
'test/testcases/block/12_extension/ignored.text',
|
30
52
|
'test/testcases/block/12_extension/nomarkdown.text',
|
53
|
+
'test/testcases/block/12_extension/options3.text', # bc no highlight support yet
|
31
54
|
'test/testcases/block/13_definition_list/item_ial.text',
|
32
55
|
'test/testcases/block/13_definition_list/multiple_terms.text',
|
33
56
|
'test/testcases/block/13_definition_list/no_def_list.text',
|
@@ -37,12 +60,29 @@ describe "gfm-to-html conversion" do
|
|
37
60
|
'test/testcases/block/14_table/escaping.text',
|
38
61
|
'test/testcases/block/14_table/simple.text',
|
39
62
|
'test/testcases/block/15_math/normal.text',
|
63
|
+
'test/testcases/block/15_math/mathjaxnode_notexhints.text',
|
64
|
+
'test/testcases/block/15_math/mathjaxnode_semantics.text',
|
65
|
+
'test/testcases/block/15_math/mathjaxnode.text',
|
66
|
+
'test/testcases/block/15_math/gh_128.text', # bc no math support yet
|
67
|
+
'test/testcases/block/15_math/itex2mml.text', # bc no math support yet
|
68
|
+
'test/testcases/block/15_math/normal.text', # bc no math support yet
|
69
|
+
'test/testcases/block/15_math/ritex.text', # bc no math support yet
|
70
|
+
'test/testcases/block/15_math/mathjax_preview.text', # bc no math support yet
|
71
|
+
'test/testcases/block/15_math/mathjax_preview_simple.text', # bc no math support yet
|
72
|
+
'test/testcases/block/15_math/mathjax_preview_as_code.text', # bc no math support yet
|
73
|
+
'test/testcases/block/16_toc/toc_with_footnotes.text', # bc of ID generation difference
|
74
|
+
|
40
75
|
'test/testcases/encoding.text',
|
76
|
+
|
41
77
|
'test/testcases/span/01_link/inline.text',
|
42
78
|
'test/testcases/span/01_link/link_defs.text',
|
43
79
|
'test/testcases/span/01_link/reference.text',
|
44
80
|
'test/testcases/span/02_emphasis/normal.text',
|
45
81
|
'test/testcases/span/03_codespan/normal.text',
|
82
|
+
'test/testcases/span/03_codespan/rouge/simple.text', # bc no highlight support yet
|
83
|
+
'test/testcases/span/03_codespan/highlighting.text', # bc no highlight support yet
|
84
|
+
'test/testcases/span/03_codespan/rouge/simple.text',
|
85
|
+
'test/testcases/span/03_codespan/rouge/multiple.text',
|
46
86
|
'test/testcases/span/04_footnote/definitions.text',
|
47
87
|
'test/testcases/span/04_footnote/markers.text',
|
48
88
|
'test/testcases/span/05_html/across_lines.text',
|
@@ -53,28 +93,21 @@ describe "gfm-to-html conversion" do
|
|
53
93
|
'test/testcases/span/extension/comment.text',
|
54
94
|
'test/testcases/span/ial/simple.text',
|
55
95
|
'test/testcases/span/line_breaks/normal.text',
|
56
|
-
'test/testcases/span/text_substitutions/entities_as_char.text',
|
57
|
-
'test/testcases/span/text_substitutions/entities.text',
|
58
|
-
'test/testcases/span/text_substitutions/typography.text',
|
59
|
-
('test/testcases/span/03_codespan/highlighting-rouge.text' if RUBY_VERSION < '2.0'),
|
60
|
-
('test/testcases/block/06_codeblock/highlighting-rouge.text' if RUBY_VERSION < '2.0'), #bc of rouge
|
61
|
-
|
62
|
-
'test/testcases/block/04_header/with_auto_ids.text', # bc no transliteration support yet
|
63
|
-
'test/testcases/block/06_codeblock/highlighting-opts.text', # bc no highlight support yet
|
64
|
-
'test/testcases/block/06_codeblock/highlighting.text', # bc no highlight support yet
|
65
|
-
'test/testcases/block/12_extension/options3.text', # bc no highlight support yet
|
66
|
-
'test/testcases/block/15_math/gh_128.text', # bc no math support yet
|
67
|
-
'test/testcases/block/15_math/itex2mml.text', # bc no math support yet
|
68
|
-
'test/testcases/block/15_math/normal.text', # bc no math support yet
|
69
|
-
'test/testcases/block/15_math/ritex.text', # bc no math support yet
|
70
|
-
'test/testcases/block/15_math/mathjax_preview.text', # bc no math support yet
|
71
|
-
'test/testcases/block/15_math/mathjax_preview_simple.text', # bc no math support yet
|
72
96
|
'test/testcases/span/math/itex2mml.text', # bc no math support yet
|
97
|
+
'test/testcases/span/math/mathjaxnode.text', # bc no math support yet
|
73
98
|
'test/testcases/span/math/normal.text', # bc no math support yet
|
74
99
|
'test/testcases/span/math/ritex.text', # bc no math support yet
|
75
|
-
'test/testcases/span/
|
76
|
-
'test/testcases/span/
|
100
|
+
'test/testcases/span/text_substitutions/entities_as_char.text',
|
101
|
+
'test/testcases/span/text_substitutions/entities.text',
|
102
|
+
'test/testcases/span/text_substitutions/typography.text',
|
103
|
+
|
77
104
|
'test/testcases_gfm/backticks_syntax.text', # bc no highlight support yet
|
105
|
+
'test/testcases_gfm/header_ids.text', # bc no math support yet
|
106
|
+
|
107
|
+
('test/testcases/block/15_math/sskatex.text' unless KATEX_AVAILABLE),
|
108
|
+
('test/testcases/span/math/sskatex.text' unless KATEX_AVAILABLE),
|
109
|
+
|
110
|
+
'test/testcases/span/04_footnote/backlink_inline.text', # bc no math support yet
|
78
111
|
].compact
|
79
112
|
|
80
113
|
['testcases', 'testcases_gfm'].each do |item|
|
@@ -5,23 +5,41 @@ describe "html-to-{html,kramdown} conversion" do
|
|
5
5
|
warn("Skipping html-to-{html,kramdown} tests because tidy executable is missing")
|
6
6
|
else
|
7
7
|
EXCLUDE_HTML_FILES = [
|
8
|
-
'test/testcases/block/06_codeblock/whitespace.html', # bc of span inside pre
|
9
|
-
'test/testcases/block/09_html/simple.html', # bc of xml elements
|
10
|
-
'test/testcases/span/03_codespan/highlighting.html', # bc of span elements inside code element
|
11
8
|
'test/testcases/block/04_header/with_auto_ids.html', # bc of auto_ids=true option
|
12
9
|
'test/testcases/block/04_header/header_type_offset.html', # bc of header_offset option
|
13
|
-
'test/testcases/block/06_codeblock/
|
14
|
-
|
10
|
+
'test/testcases/block/06_codeblock/whitespace.html', # bc of span inside pre
|
11
|
+
'test/testcases/block/06_codeblock/rouge/simple.html', # bc of double surrounding <div>
|
12
|
+
'test/testcases/block/06_codeblock/rouge/multiple.html', # bc of double surrounding <div>
|
13
|
+
'test/testcases/block/09_html/simple.html', # bc of xml elements
|
14
|
+
'test/testcases/block/09_html/xml.html', # bc of tidy
|
15
15
|
'test/testcases/block/15_math/ritex.html', # bc of tidy
|
16
|
-
'test/testcases/span/math/ritex.html', # bc of tidy
|
17
16
|
'test/testcases/block/15_math/itex2mml.html', # bc of tidy
|
18
|
-
'test/testcases/span/math/itex2mml.html', # bc of tidy
|
19
17
|
'test/testcases/block/15_math/mathjax_preview.html', # bc of mathjax preview
|
20
18
|
'test/testcases/block/15_math/mathjax_preview_simple.html', # bc of mathjax preview
|
21
|
-
|
19
|
+
'test/testcases/block/15_math/mathjax_preview_as_code.html', # bc no math support yet
|
22
20
|
'test/testcases/block/15_math/gh_128.html', # bc no math support yet
|
23
21
|
'test/testcases/block/15_math/normal.html', # bc no math support yet
|
22
|
+
|
23
|
+
'test/testcases/span/03_codespan/highlighting.html', # bc of span elements inside code element
|
24
|
+
('test/testcases/span/03_codespan/rouge/simple.html' if RUBY_VERSION < '2.0'),
|
25
|
+
'test/testcases/span/05_html/mark_element.html', # bc of tidy
|
26
|
+
'test/testcases/span/05_html/xml.html', # bc of tidy
|
27
|
+
'test/testcases/span/math/ritex.html', # bc of tidy
|
28
|
+
'test/testcases/span/math/itex2mml.html', # bc of tidy
|
24
29
|
'test/testcases/span/math/normal.html', # bc no math support yet
|
30
|
+
|
31
|
+
'test/testcases/block/16_toc/toc_with_footnotes.html', # bc of issue with nbsp
|
32
|
+
'test/testcases/block/12_extension/options.html', # bc of issue with nbsp
|
33
|
+
'test/testcases/block/12_extension/options2.html', # bc of issue with nbsp
|
34
|
+
'test/testcases/span/04_footnote/footnote_nr.html', # bc of issue with nbsp
|
35
|
+
'test/testcases/span/04_footnote/inside_footnote.html', # bc of issue with nbsp
|
36
|
+
'test/testcases/span/04_footnote/backlink_text.html', # bc of issue with nbsp
|
37
|
+
'test/testcases/span/abbreviations/in_footnote.html', # bc of issue with nbsp
|
38
|
+
|
39
|
+
'test/testcases/span/math/sskatex.html', # bc of tidy
|
40
|
+
'test/testcases/block/15_math/sskatex.html', # bc of tidy
|
41
|
+
|
42
|
+
'test/testcases/span/04_footnote/backlink_inline.html', # bc no math support yet
|
25
43
|
].compact
|
26
44
|
|
27
45
|
EXCLUDE_HTML_TEXT_FILES = ['test/testcases/block/09_html/parse_as_span.htmlinput',
|
@@ -41,7 +59,7 @@ describe "html-to-{html,kramdown} conversion" do
|
|
41
59
|
end
|
42
60
|
|
43
61
|
out_files.select {|f, _| File.exist?(f)}.each do |out_file, out_method|
|
44
|
-
|
62
|
+
|
45
63
|
it "#{short_name(html_file)} --> #{File.extname(out_file)}" do
|
46
64
|
options = load_options(opts_file)
|
47
65
|
doc = Kramdown::Document.new(File.read(html_file), options.merge(:input => 'html'))
|