commonmarker 0.23.4 → 0.23.5
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of commonmarker might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Rakefile +56 -55
- data/commonmarker.gemspec +26 -27
- data/ext/commonmarker/cmark-gfm_version.h +2 -2
- data/ext/commonmarker/commonmarker.c +1 -0
- data/ext/commonmarker/scanners.c +2438 -2450
- data/lib/commonmarker/config.rb +3 -3
- data/lib/commonmarker/node/inspect.rb +8 -18
- data/lib/commonmarker/node.rb +6 -6
- data/lib/commonmarker/renderer/html_renderer.rb +37 -37
- data/lib/commonmarker/renderer.rb +5 -5
- data/lib/commonmarker/version.rb +1 -1
- data/lib/commonmarker.rb +9 -9
- metadata +4 -57
- data/lib/commonmarker/errors.rb +0 -12
- data/test/benchmark.rb +0 -39
- data/test/fixtures/curly.md +0 -1
- data/test/fixtures/dingus.md +0 -10
- data/test/fixtures/strong.md +0 -1
- data/test/fixtures/table.md +0 -10
- data/test/test_attributes.rb +0 -24
- data/test/test_basics.rb +0 -35
- data/test/test_commands.rb +0 -72
- data/test/test_commonmark.rb +0 -36
- data/test/test_doc.rb +0 -130
- data/test/test_encoding.rb +0 -23
- data/test/test_extensions.rb +0 -116
- data/test/test_footnotes.rb +0 -60
- data/test/test_gc.rb +0 -47
- data/test/test_helper.rb +0 -71
- data/test/test_linebreaks.rb +0 -15
- data/test/test_maliciousness.rb +0 -262
- data/test/test_node.rb +0 -89
- data/test/test_options.rb +0 -37
- data/test/test_pathological_inputs.rb +0 -94
- data/test/test_plaintext.rb +0 -46
- data/test/test_renderer.rb +0 -47
- data/test/test_smartpunct.rb +0 -27
- data/test/test_spec.rb +0 -30
- data/test/test_tasklists.rb +0 -43
- data/test/test_xml.rb +0 -107
data/test/test_xml.rb
DELETED
@@ -1,107 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'test_helper'
|
4
|
-
|
5
|
-
class TestXml < Minitest::Test
|
6
|
-
def setup
|
7
|
-
@markdown = <<~MD
|
8
|
-
Hi *there*!
|
9
|
-
|
10
|
-
1. I am a numeric list.
|
11
|
-
2. I continue the list.
|
12
|
-
* Suddenly, an unordered list!
|
13
|
-
* What fun!
|
14
|
-
|
15
|
-
Okay, _enough_.
|
16
|
-
|
17
|
-
| a | b |
|
18
|
-
| --- | --- |
|
19
|
-
| c | d |
|
20
|
-
MD
|
21
|
-
end
|
22
|
-
|
23
|
-
def render_doc(doc)
|
24
|
-
CommonMarker.render_doc(doc, :DEFAULT, [:table])
|
25
|
-
end
|
26
|
-
|
27
|
-
def test_to_xml
|
28
|
-
compare = render_doc(@markdown).to_xml(:SOURCEPOS)
|
29
|
-
|
30
|
-
assert_equal <<~XML, compare
|
31
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
32
|
-
<!DOCTYPE document SYSTEM "CommonMark.dtd">
|
33
|
-
<document sourcepos="1:1-12:13" xmlns="http://commonmark.org/xml/1.0">
|
34
|
-
<paragraph sourcepos="1:1-1:11">
|
35
|
-
<text sourcepos="1:1-1:3" xml:space="preserve">Hi </text>
|
36
|
-
<emph sourcepos="1:4-1:10">
|
37
|
-
<text sourcepos="1:5-1:9" xml:space="preserve">there</text>
|
38
|
-
</emph>
|
39
|
-
<text sourcepos="1:11-1:11" xml:space="preserve">!</text>
|
40
|
-
</paragraph>
|
41
|
-
<list sourcepos="3:1-4:23" type="ordered" start="1" delim="period" tight="true">
|
42
|
-
<item sourcepos="3:1-3:23">
|
43
|
-
<paragraph sourcepos="3:4-3:23">
|
44
|
-
<text sourcepos="3:4-3:23" xml:space="preserve">I am a numeric list.</text>
|
45
|
-
</paragraph>
|
46
|
-
</item>
|
47
|
-
<item sourcepos="4:1-4:23">
|
48
|
-
<paragraph sourcepos="4:4-4:23">
|
49
|
-
<text sourcepos="4:4-4:23" xml:space="preserve">I continue the list.</text>
|
50
|
-
</paragraph>
|
51
|
-
</item>
|
52
|
-
</list>
|
53
|
-
<list sourcepos="5:1-7:0" type="bullet" tight="true">
|
54
|
-
<item sourcepos="5:1-5:30">
|
55
|
-
<paragraph sourcepos="5:3-5:30">
|
56
|
-
<text sourcepos="5:3-5:30" xml:space="preserve">Suddenly, an unordered list!</text>
|
57
|
-
</paragraph>
|
58
|
-
</item>
|
59
|
-
<item sourcepos="6:1-7:0">
|
60
|
-
<paragraph sourcepos="6:3-6:11">
|
61
|
-
<text sourcepos="6:3-6:11" xml:space="preserve">What fun!</text>
|
62
|
-
</paragraph>
|
63
|
-
</item>
|
64
|
-
</list>
|
65
|
-
<paragraph sourcepos="8:1-8:15">
|
66
|
-
<text sourcepos="8:1-8:6" xml:space="preserve">Okay, </text>
|
67
|
-
<emph sourcepos="8:7-8:14">
|
68
|
-
<text sourcepos="8:8-8:13" xml:space="preserve">enough</text>
|
69
|
-
</emph>
|
70
|
-
<text sourcepos="8:15-8:15" xml:space="preserve">.</text>
|
71
|
-
</paragraph>
|
72
|
-
<table sourcepos="10:1-12:13">
|
73
|
-
<table_header sourcepos="10:1-10:13">
|
74
|
-
<table_cell sourcepos="10:2-10:6">
|
75
|
-
<text sourcepos="10:3-10:3" xml:space="preserve">a</text>
|
76
|
-
</table_cell>
|
77
|
-
<table_cell sourcepos="10:8-10:12">
|
78
|
-
<text sourcepos="10:9-10:9" xml:space="preserve">b</text>
|
79
|
-
</table_cell>
|
80
|
-
</table_header>
|
81
|
-
<table_row sourcepos="12:1-12:13">
|
82
|
-
<table_cell sourcepos="12:2-12:6">
|
83
|
-
<text sourcepos="12:3-12:3" xml:space="preserve">c</text>
|
84
|
-
</table_cell>
|
85
|
-
<table_cell sourcepos="12:8-12:12">
|
86
|
-
<text sourcepos="12:9-12:9" xml:space="preserve">d</text>
|
87
|
-
</table_cell>
|
88
|
-
</table_row>
|
89
|
-
</table>
|
90
|
-
</document>
|
91
|
-
XML
|
92
|
-
end
|
93
|
-
|
94
|
-
def test_to_xml_with_quotes
|
95
|
-
compare = render_doc('"quotes" should be escaped').to_xml(:DEFAULT)
|
96
|
-
|
97
|
-
assert_equal <<~XML, compare
|
98
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
99
|
-
<!DOCTYPE document SYSTEM "CommonMark.dtd">
|
100
|
-
<document xmlns="http://commonmark.org/xml/1.0">
|
101
|
-
<paragraph>
|
102
|
-
<text xml:space="preserve">"quotes" should be escaped</text>
|
103
|
-
</paragraph>
|
104
|
-
</document>
|
105
|
-
XML
|
106
|
-
end
|
107
|
-
end
|