kramdown 2.1.0 → 2.4.0

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.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTERS +19 -3
  3. data/README.md +8 -2
  4. data/VERSION +1 -1
  5. data/lib/kramdown/converter/base.rb +2 -1
  6. data/lib/kramdown/converter/html.rb +37 -30
  7. data/lib/kramdown/converter/kramdown.rb +20 -10
  8. data/lib/kramdown/converter/latex.rb +2 -2
  9. data/lib/kramdown/converter/math_engine/mathjax.rb +7 -33
  10. data/lib/kramdown/converter/syntax_highlighter/rouge.rb +17 -9
  11. data/lib/kramdown/converter/syntax_highlighter.rb +1 -1
  12. data/lib/kramdown/element.rb +24 -0
  13. data/lib/kramdown/options.rb +62 -12
  14. data/lib/kramdown/parser/base.rb +3 -1
  15. data/lib/kramdown/parser/html.rb +16 -9
  16. data/lib/kramdown/parser/kramdown/abbreviation.rb +1 -1
  17. data/lib/kramdown/parser/kramdown/autolink.rb +2 -2
  18. data/lib/kramdown/parser/kramdown/codespan.rb +18 -4
  19. data/lib/kramdown/parser/kramdown/emphasis.rb +1 -1
  20. data/lib/kramdown/parser/kramdown/extensions.rb +6 -0
  21. data/lib/kramdown/parser/kramdown/header.rb +3 -2
  22. data/lib/kramdown/parser/kramdown/html.rb +4 -10
  23. data/lib/kramdown/parser/kramdown/list.rb +37 -9
  24. data/lib/kramdown/parser/kramdown/math.rb +1 -1
  25. data/lib/kramdown/parser/kramdown/table.rb +2 -2
  26. data/lib/kramdown/parser/kramdown.rb +8 -1
  27. data/lib/kramdown/utils/html.rb +9 -0
  28. data/lib/kramdown/version.rb +1 -1
  29. data/man/man1/kramdown.1 +23 -0
  30. data/test/test_files.rb +28 -18
  31. data/test/test_location.rb +2 -2
  32. data/test/test_string_scanner_kramdown.rb +1 -1
  33. data/test/testcases/block/03_paragraph/standalone_image.html +5 -0
  34. data/test/testcases/block/03_paragraph/standalone_image.text +3 -0
  35. data/test/testcases/block/03_paragraph/to_kramdown.kramdown +7 -0
  36. data/test/testcases/block/03_paragraph/to_kramdown.text +5 -0
  37. data/test/testcases/block/04_header/atx_header.html +6 -0
  38. data/test/testcases/block/04_header/atx_header.text +6 -0
  39. data/test/testcases/block/06_codeblock/rouge/multiple.html +1 -1
  40. data/test/testcases/block/06_codeblock/rouge/simple.html +1 -1
  41. data/test/testcases/block/09_html/processing_instruction.html +5 -6
  42. data/test/testcases/block/09_html/standalone_image_in_div.htmlinput +7 -0
  43. data/test/testcases/block/09_html/standalone_image_in_div.text +8 -0
  44. data/test/testcases/block/09_html/table.kramdown +8 -0
  45. data/test/testcases/block/09_html/table.text +7 -0
  46. data/test/testcases/block/12_extension/options.html +4 -4
  47. data/test/testcases/block/12_extension/options.text +2 -0
  48. data/test/testcases/block/12_extension/options2.html +4 -4
  49. data/test/testcases/block/14_table/table_with_footnote.html +4 -4
  50. data/test/testcases/block/15_math/gh_128.html +1 -2
  51. data/test/testcases/block/15_math/normal.html +16 -15
  52. data/test/testcases/block/16_toc/toc_with_footnotes.html +4 -4
  53. data/test/testcases/cjk-line-break.html +4 -0
  54. data/test/testcases/cjk-line-break.options +1 -0
  55. data/test/testcases/cjk-line-break.text +12 -0
  56. data/test/testcases/man/example.man +1 -1
  57. data/test/testcases/man/example.text +1 -1
  58. data/test/testcases/span/02_emphasis/normal.html +4 -0
  59. data/test/testcases/span/02_emphasis/normal.text +4 -0
  60. data/test/testcases/span/03_codespan/normal.html +4 -0
  61. data/test/testcases/span/03_codespan/normal.text +4 -0
  62. data/test/testcases/span/04_footnote/backlink_inline.html +21 -21
  63. data/test/testcases/span/04_footnote/backlink_text.html +4 -4
  64. data/test/testcases/span/04_footnote/footnote_nr.html +6 -6
  65. data/test/testcases/span/04_footnote/footnote_prefix.html +6 -6
  66. data/test/testcases/span/04_footnote/inside_footnote.html +9 -9
  67. data/test/testcases/span/04_footnote/markers.html +16 -16
  68. data/test/testcases/span/04_footnote/placement.html +4 -4
  69. data/test/testcases/span/04_footnote/regexp_problem.html +4 -4
  70. data/test/testcases/span/04_footnote/without_backlink.html +3 -3
  71. data/test/testcases/span/05_html/normal.html +1 -1
  72. data/test/testcases/span/abbreviations/abbrev_in_html.html +9 -0
  73. data/test/testcases/span/abbreviations/abbrev_in_html.text +10 -0
  74. data/test/testcases/span/abbreviations/in_footnote.html +4 -4
  75. data/test/testcases/span/math/normal.html +4 -4
  76. data/test/testcases/span/text_substitutions/entities.html +1 -1
  77. data/test/testcases/span/text_substitutions/entities.text +1 -1
  78. metadata +36 -15
  79. data/test/testcases/block/15_math/mathjax_preview.html +0 -4
  80. data/test/testcases/block/15_math/mathjax_preview.options +0 -2
  81. data/test/testcases/block/15_math/mathjax_preview.text +0 -5
  82. data/test/testcases/block/15_math/mathjax_preview_as_code.html +0 -4
  83. data/test/testcases/block/15_math/mathjax_preview_as_code.options +0 -3
  84. data/test/testcases/block/15_math/mathjax_preview_as_code.text +0 -5
  85. data/test/testcases/block/15_math/mathjax_preview_simple.html +0 -4
  86. data/test/testcases/block/15_math/mathjax_preview_simple.options +0 -2
  87. data/test/testcases/block/15_math/mathjax_preview_simple.text +0 -5
data/test/test_files.rb CHANGED
@@ -11,6 +11,7 @@ require 'minitest/autorun'
11
11
  require 'kramdown'
12
12
  require 'yaml'
13
13
  require 'tmpdir'
14
+ require 'open3'
14
15
 
15
16
  begin
16
17
  require 'kramdown/converter/syntax_highlighter/rouge'
@@ -20,16 +21,20 @@ begin
20
21
  end
21
22
 
22
23
  # custom formatter for tests
23
- class RougeHTMLFormatters < Kramdown::Converter::SyntaxHighlighter::Rouge.formatter_class
24
+ module Rouge
25
+ module Formatters
26
+ class RougeHTMLFormatters < Kramdown::Converter::SyntaxHighlighter::Rouge.formatter_class
24
27
 
25
- tag 'rouge_html_formatters'
28
+ tag 'rouge_html_formatters'
26
29
 
27
- def stream(tokens, &b)
28
- yield %(<div class="custom-class">)
29
- super
30
- yield %(</div>)
31
- end
30
+ def stream(tokens, &b)
31
+ yield %(<div class="custom-class">)
32
+ super
33
+ yield %(</div>)
34
+ end
32
35
 
36
+ end
37
+ end
33
38
  end
34
39
  rescue LoadError, SyntaxError, NameError
35
40
  end
@@ -111,14 +116,10 @@ class TestFiles < Minitest::Test
111
116
  end
112
117
 
113
118
  def tidy_output(out)
114
- cmd = "tidy -q --doctype omit #{RUBY_VERSION >= '1.9' ? '-utf8' : '-raw'} 2>/dev/null"
115
- result = IO.popen(cmd, 'r+') do |io|
116
- io.write(out)
117
- io.close_write
118
- io.read
119
- end
120
- if $?.exitstatus == 2
121
- raise "Problem using tidy"
119
+ cmd = "tidy -q --doctype omit -utf8"
120
+ result, error, status = Open3.capture3(cmd, stdin_data: out)
121
+ if status.exitstatus == 2
122
+ raise "Problem using tidy: #{error}"
122
123
  end
123
124
  result
124
125
  end
@@ -136,6 +137,7 @@ class TestFiles < Minitest::Test
136
137
  'test/testcases/block/06_codeblock/with_lang_in_fenced_block_name_with_dash.text',
137
138
  'test/testcases/block/06_codeblock/with_lang_in_fenced_block_any_char.text',
138
139
  'test/testcases/block/03_paragraph/standalone_image.text', # bc of standalone image
140
+ 'test/testcases/cjk-line-break.text', # latex unicode support
139
141
  ].compact
140
142
  Dir[File.dirname(__FILE__) + '/testcases/**/*.text'].each do |text_file|
141
143
  next if EXCLUDE_LATEX_FILES.any? {|f| text_file =~ /#{f}$/ }
@@ -180,6 +182,9 @@ class TestFiles < Minitest::Test
180
182
  'test/testcases/block/09_html/xml.text', # bc of tidy
181
183
  'test/testcases/span/05_html/xml.text', # bc of tidy
182
184
  'test/testcases/block/03_paragraph/standalone_image.text', # bc of standalone image
185
+ 'test/testcases/cjk-line-break.text',
186
+ 'test/testcases/block/09_html/standalone_image_in_div.html', # bc of standalone image
187
+ 'test/testcases/span/abbreviations/abbrev_in_html.text', # bc of invalid abbr tag in SVG
183
188
  ].compact
184
189
  Dir[File.dirname(__FILE__) + '/testcases/**/*.text'].each do |text_file|
185
190
  next if EXCLUDE_TEXT_FILES.any? {|f| text_file =~ /#{f}$/ }
@@ -192,6 +197,9 @@ class TestFiles < Minitest::Test
192
197
  kdtext = Kramdown::Document.new(File.read(text_file), options).to_kramdown
193
198
  html = Kramdown::Document.new(kdtext, options).to_html
194
199
  assert_equal(tidy_output(File.read(html_file)), tidy_output(html))
200
+ kdtext4 = Kramdown::Document.new(File.read(text_file), options.merge({list_indent: 4})).to_kramdown
201
+ html = Kramdown::Document.new(kdtext4, options).to_html
202
+ assert_equal(tidy_output(File.read(html_file)), tidy_output(html))
195
203
  end
196
204
  end
197
205
  end
@@ -222,14 +230,16 @@ class TestFiles < Minitest::Test
222
230
  'test/testcases/block/16_toc/toc_exclude.html', # bc of different attribute ordering
223
231
  'test/testcases/span/autolinks/url_links.html', # bc of quot entity being converted to char
224
232
  'test/testcases/block/14_table/empty_tag_in_cell.html', # bc of tidy
225
- 'test/testcases/block/15_math/mathjax_preview.html', # bc of mathjax preview
226
- 'test/testcases/block/15_math/mathjax_preview_simple.html', # bc of mathjax preview
227
- 'test/testcases/block/15_math/mathjax_preview_as_code.html', # bc of mathjax preview
228
233
  'test/testcases/span/01_link/link_defs_with_ial.html', # bc of attribute ordering
229
234
  'test/testcases/span/05_html/mark_element.html', # bc of tidy
230
235
  'test/testcases/block/09_html/xml.html', # bc of tidy
231
236
  'test/testcases/span/05_html/xml.html', # bc of tidy
232
237
  'test/testcases/block/03_paragraph/standalone_image.html', # bc of standalone image
238
+ 'test/testcases/block/15_math/normal.html', # bc of mathjax and HTML parser
239
+ 'test/testcases/block/15_math/gh_128.html', # bc of mathjax and HTML parser
240
+ 'test/testcases/span/04_footnote/backlink_inline.html', # bc of mathjax
241
+ 'test/testcases/block/09_html/standalone_image_in_div.html', # bc of standalone image
242
+ 'test/testcases/block/09_html/processing_instruction.html', # bc of PI
233
243
  ].compact
234
244
  Dir[File.dirname(__FILE__) + '/testcases/**/*.html'].each do |html_file|
235
245
  next if EXCLUDE_HTML_KD_FILES.any? {|f| html_file =~ /#{f}$/ }
@@ -18,7 +18,7 @@ describe 'location' do
18
18
  def check_element_for_location(element)
19
19
  if (match = /^line-(\d+)/.match(element.attr['class'] || ''))
20
20
  expected_line = match[1].to_i
21
- element.options[:location].must_equal(expected_line)
21
+ assert_equal(expected_line, element.options[:location])
22
22
  end
23
23
  element.children.each do |child|
24
24
  check_element_for_location(child)
@@ -187,7 +187,7 @@ describe 'location' do
187
187
  *[duplicate]: The second definition
188
188
  )
189
189
  doc = Kramdown::Document.new(test_string.strip)
190
- doc.warnings.must_equal ["Duplicate abbreviation ID 'duplicate' on line 4 - overwriting"]
190
+ assert_equal(["Duplicate abbreviation ID 'duplicate' on line 4 - overwriting"], doc.warnings)
191
191
  end
192
192
 
193
193
  it 'handles abbreviations' do
@@ -21,7 +21,7 @@ describe Kramdown::Utils::StringScanner do
21
21
  it "computes the correct current_line_number for example ##{i + 1}" do
22
22
  str_sc = Kramdown::Utils::StringScanner.new(test_string)
23
23
  scan_regexes.each {|scan_re| str_sc.scan_until(scan_re) }
24
- str_sc.current_line_number.must_equal expect
24
+ assert_equal(expect, str_sc.current_line_number)
25
25
  end
26
26
  end
27
27
  end
@@ -5,4 +5,9 @@
5
5
  <figcaption>standalone image</figcaption>
6
6
  </figure>
7
7
 
8
+ <figure id="block-id" class="block-class" block-key="block-value">
9
+ <img src="some.jpg" alt="standalone image" id="id" class="class" key="value" />
10
+ <figcaption>standalone image</figcaption>
11
+ </figure>
12
+
8
13
  <p>para</p>
@@ -3,4 +3,7 @@ para
3
3
 
4
4
  ![standalone image](some.jpg){:#id .class key="value" standalone}
5
5
 
6
+ ![standalone image](some.jpg){:#id .class key="value" standalone}
7
+ {:#block-id .block-class block-key="block-value"}
8
+
6
9
  para
@@ -0,0 +1,7 @@
1
+ aa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa
2
+ \: No definiion list
3
+
4
+ a:
5
+
6
+ *a*:
7
+
@@ -0,0 +1,5 @@
1
+ aa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa : No definiion list
2
+
3
+ a:
4
+
5
+ *a*:
@@ -26,6 +26,12 @@
26
26
  ### not a header</p>
27
27
  </blockquote>
28
28
 
29
+ <h1>header</h1>
30
+
31
+ <h1>header</h1>
32
+
33
+ <h1>header</h1>
34
+
29
35
  <h1>header #</h1>
30
36
 
31
37
  <h1>header</h1>
@@ -23,6 +23,12 @@ paragraph
23
23
  > blockquote
24
24
  ### not a header
25
25
 
26
+ # header #
27
+
28
+ # header#
29
+
30
+ #header#
31
+
26
32
  # header \#
27
33
 
28
34
  # header
@@ -6,6 +6,6 @@
6
6
  </code></pre>
7
7
  </div></div></div>
8
8
 
9
- <div class="language-php highlighter-rouge"><div class="custom-class"><div class="highlight"><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
+ <div class="language-php highlighter-rouge"><div class="custom-class"><div class="highlight"><pre class="highlight"><code><span class="nv">$foo</span> <span class="o">=</span> <span class="k">new</span> <span class="nc">Bar</span><span class="p">;</span>
10
10
  </code></pre>
11
11
  </div></div></div>
@@ -5,6 +5,6 @@
5
5
  </code></pre>
6
6
  </div></div>
7
7
 
8
- <div class="language-php highlighter-rouge"><div class="highlight"><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>
8
+ <div class="language-php highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$foo</span> <span class="o">=</span> <span class="k">new</span> <span class="nc">Bar</span><span class="p">;</span>
9
9
  </code></pre>
10
10
  </div></div>
@@ -1,13 +1,12 @@
1
- <?xml version="1.0"?>
1
+ <p>&lt;?xml version=”1.0”?&gt;</p>
2
2
 
3
3
  <p>para</p>
4
4
 
5
- <? test ?>
6
- <p>para</p>
5
+ <p>&lt;? test ?&gt; para</p>
7
6
 
8
7
  <p>other</p>
9
8
 
10
- <?
11
- multiline *text*
9
+ <p>&lt;?
10
+ multiline <em>text</em>
12
11
  is allowed
13
- ?>
12
+ ?&gt;</p>
@@ -0,0 +1,7 @@
1
+ <div class="example-1">
2
+ <img src="src.png" alt="inside" />
3
+ </div>
4
+
5
+ <div class="example-2">
6
+ <a href="website.html">text</a>
7
+ </div>
@@ -0,0 +1,8 @@
1
+ <div class="example-1" markdown="1">
2
+ ![inside](src.png)
3
+ </div>
4
+
5
+ <div class="example-2" markdown="1">
6
+ [text](website.html)
7
+ </div>
8
+
@@ -0,0 +1,8 @@
1
+ <table>
2
+ <tr>
3
+ <th>test</th>
4
+ <th></th>
5
+ <td></td>
6
+ </tr>
7
+ </table>
8
+
@@ -0,0 +1,7 @@
1
+ <table>
2
+ <tr>
3
+ <th>test</th>
4
+ <th></th>
5
+ <td></td>
6
+ </tr>
7
+ </table>
@@ -10,12 +10,12 @@ some <span>*para*</span>
10
10
  <p>some <span><em>para</em></span></p>
11
11
  </div>
12
12
 
13
- <p>Some text<sup id="fnref:ab"><a href="#fn:ab" class="footnote">10</a></sup>.</p>
13
+ <p>Some text<sup id="fnref:ab" role="doc-noteref"><a href="#fn:ab" class="footnote" rel="footnote">10</a></sup>.</p>
14
14
 
15
- <div class="footnotes">
15
+ <div class="footnotes" role="doc-endnotes">
16
16
  <ol start="10">
17
- <li id="fn:ab">
18
- <p>Some text. <a href="#fnref:ab" class="reversefootnote">&#8617;</a></p>
17
+ <li id="fn:ab" role="doc-endnote">
18
+ <p>Some text. <a href="#fnref:ab" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
19
19
  </li>
20
20
  </ol>
21
21
  </div>
@@ -19,3 +19,5 @@ some <span>*para*</span>
19
19
  Some text[^ab].
20
20
 
21
21
  [^ab]: Some text.
22
+
23
+ {::options template="/etc/passwd" /}
@@ -1,10 +1,10 @@
1
1
 
2
- <p>Some text<sup id="fnref:ab"><a href="#fn:ab" class="footnote">1</a></sup>.</p>
2
+ <p>Some text<sup id="fnref:ab" role="doc-noteref"><a href="#fn:ab" class="footnote" rel="footnote">1</a></sup>.</p>
3
3
 
4
- <div class="footnotes">
4
+ <div class="footnotes" role="doc-endnotes">
5
5
  <ol>
6
- <li id="fn:ab">
7
- <p>Some text. <a href="#fnref:ab" class="reversefootnote">&#8617;</a></p>
6
+ <li id="fn:ab" role="doc-endnote">
7
+ <p>Some text. <a href="#fnref:ab" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
8
8
  </li>
9
9
  </ol>
10
10
  </div>
@@ -1,7 +1,7 @@
1
1
  <table>
2
2
  <tbody>
3
3
  <tr>
4
- <td>this is <sup id="fnref:1"><a href="#fn:1" class="footnote">1</a></sup></td>
4
+ <td>this is <sup id="fnref:1" role="doc-noteref"><a href="#fn:1" class="footnote" rel="footnote">1</a></sup></td>
5
5
  <td>a table</td>
6
6
  </tr>
7
7
  <tr>
@@ -11,15 +11,15 @@
11
11
  </tbody>
12
12
  </table>
13
13
 
14
- <div class="footnotes">
14
+ <div class="footnotes" role="doc-endnotes">
15
15
  <ol>
16
- <li id="fn:1">
16
+ <li id="fn:1" role="doc-endnote">
17
17
  <p>Something</p>
18
18
 
19
19
  <blockquote>
20
20
  <p>special here</p>
21
21
  </blockquote>
22
- <p><a href="#fnref:1" class="reversefootnote">&#8617;</a></p>
22
+ <p><a href="#fnref:1" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
23
23
  </li>
24
24
  </ol>
25
25
  </div>
@@ -1,2 +1 @@
1
- <script type="math/tex; mode=display">% <![CDATA[
2
- alert('a') alert('b<') %]]></script>
1
+ \[&lt;script&gt;alert('a')&lt;/script&gt; &lt;script&gt;alert('b&lt;')&lt;/script&gt;\]
@@ -1,29 +1,30 @@
1
1
  <p>This is a para.
2
- <script type="math/tex">\text{LaTeX} \lambda_5</script></p>
2
+ \(\text{LaTeX} \lambda_5\)</p>
3
3
 
4
- <script type="math/tex; mode=display">\lambda_5 = \alpha + 4</script>
4
+ \[\lambda_5 = \alpha + 4\]
5
5
 
6
- <p><script type="math/tex">\lambda_\alpha > 5</script>
6
+ <p>\(\lambda_\alpha &gt; 5\)
7
7
  This is a para.</p>
8
8
 
9
- <script type="math/tex; mode=display">% <![CDATA[
10
- \begin{align*}
11
- &=5 \\
12
- &=6 \\
13
- \end{align*} %]]></script>
9
+ \[\begin{align*}
10
+ &amp;=5 \\
11
+ &amp;=6 \\
12
+ \end{align*}\]
14
13
 
15
- <script type="math/tex; mode=display">5+5</script>
14
+ \[5+5\]
16
15
 
17
- <script type="math/tex; mode=display">5+5</script>
16
+ \[5+5\]
18
17
 
19
- <script type="math/tex; mode=display">5+5</script>
18
+ \[5+5\]
20
19
 
21
- <script type="math/tex; mode=display">5+5</script>
20
+ \[5+5\]
22
21
 
23
22
  <pre><code>$$5+5$$
24
23
  </code></pre>
25
24
 
26
- <script type="math/tex; mode=display">5+5</script>
27
- <script type="math/tex; mode=display">5+5</script>
25
+ <div class="cls">\[5+5\]
26
+ </div>
27
+ <div class="cls">\[5+5\]
28
+ </div>
28
29
 
29
- <script type="math/tex; mode=display">|x| = 5</script>
30
+ \[|x| = 5\]
@@ -2,12 +2,12 @@
2
2
  <li><a href="#header1-level-1" id="markdown-toc-header1-level-1">Header level 1</a></li>
3
3
  </ul>
4
4
 
5
- <h1 id="header1-level-1">Header<sup id="fnref:1"><a href="#fn:1" class="footnote">1</a></sup> level 1</h1>
5
+ <h1 id="header1-level-1">Header<sup id="fnref:1" role="doc-noteref"><a href="#fn:1" class="footnote" rel="footnote">1</a></sup> level 1</h1>
6
6
 
7
- <div class="footnotes">
7
+ <div class="footnotes" role="doc-endnotes">
8
8
  <ol>
9
- <li id="fn:1">
10
- <p>Some footnote content here <a href="#fnref:1" class="reversefootnote">&#8617;</a></p>
9
+ <li id="fn:1" role="doc-endnote">
10
+ <p>Some footnote content here <a href="#fnref:1" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
11
11
  </li>
12
12
  </ol>
13
13
  </div>
@@ -0,0 +1,4 @@
1
+ <p>一二三四五</p>
2
+
3
+ <p>あいうえお</p>
4
+
@@ -0,0 +1 @@
1
+ :remove_line_breaks_for_cjk: true
@@ -0,0 +1,12 @@
1
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
@@ -114,7 +114,7 @@ line breaks\.
114
114
  .P
115
115
  Abbreviations like MD can be used but the abbreviation title is ignored\.
116
116
  .P
117
- Math elements work \fB\el = 5\fP inline and in block form:
117
+ Math elements work \fB\elambda = 5\fP inline and in block form:
118
118
  .sp
119
119
  .RS 4
120
120
  .EX
@@ -80,6 +80,6 @@ ignored.
80
80
 
81
81
  *[MD]: Markdown
82
82
 
83
- Math elements work $$\l = 5$$ inline and in block form:
83
+ Math elements work $$\lambda = 5$$ inline and in block form:
84
84
 
85
85
  $$\lambda_5 = \alpha + 4$$
@@ -59,3 +59,7 @@ Or that *<em>that*</em> way</p>
59
59
  <li>`<em>test</em>&#8217;</li>
60
60
  <li>„<em>test</em>“</li>
61
61
  </ul>
62
+
63
+ <p>it&#8211;by design&#8211;<em>cannot have side-effects</em>.</p>
64
+
65
+ <p>it&#8212;by design&#8212;<em>cannot have side-effects</em>.</p>
@@ -57,3 +57,7 @@ Or that \**that\** way
57
57
  - “_test_”
58
58
  - \`_test_'
59
59
  - „_test_“
60
+
61
+ it--by design--_cannot have side-effects_.
62
+
63
+ it---by design---_cannot have side-effects_.
@@ -14,3 +14,7 @@ As `are` these!</p>
14
14
  <p>No <code>literal backtick</code>.</p>
15
15
 
16
16
  <p><code>something</code></p>
17
+
18
+ <p>` `</p>
19
+
20
+ <p>a ` `</p>
@@ -14,3 +14,7 @@ As \`are\` these!
14
14
  No `` literal backtick``.
15
15
 
16
16
  `something`
17
+
18
+ ` `
19
+
20
+ a ` `
@@ -1,30 +1,30 @@
1
- <p>This is <sup id="fnref:paragraph"><a href="#fn:paragraph" class="footnote">1</a></sup><sup id="fnref:header"><a href="#fn:header" class="footnote">2</a></sup><sup id="fnref:blockquote"><a href="#fn:blockquote" class="footnote">3</a></sup><sup id="fnref:codeblock"><a href="#fn:codeblock" class="footnote">4</a></sup><sup id="fnref:list"><a href="#fn:list" class="footnote">5</a></sup><sup id="fnref:table"><a href="#fn:table" class="footnote">6</a></sup><sup id="fnref:hrule"><a href="#fn:hrule" class="footnote">7</a></sup><sup id="fnref:mathblock"><a href="#fn:mathblock" class="footnote">8</a></sup><sup id="fnref:html"><a href="#fn:html" class="footnote">9</a></sup></p>
1
+ <p>This is <sup id="fnref:paragraph" role="doc-noteref"><a href="#fn:paragraph" class="footnote" rel="footnote">1</a></sup><sup id="fnref:header" role="doc-noteref"><a href="#fn:header" class="footnote" rel="footnote">2</a></sup><sup id="fnref:blockquote" role="doc-noteref"><a href="#fn:blockquote" class="footnote" rel="footnote">3</a></sup><sup id="fnref:codeblock" role="doc-noteref"><a href="#fn:codeblock" class="footnote" rel="footnote">4</a></sup><sup id="fnref:list" role="doc-noteref"><a href="#fn:list" class="footnote" rel="footnote">5</a></sup><sup id="fnref:table" role="doc-noteref"><a href="#fn:table" class="footnote" rel="footnote">6</a></sup><sup id="fnref:hrule" role="doc-noteref"><a href="#fn:hrule" class="footnote" rel="footnote">7</a></sup><sup id="fnref:mathblock" role="doc-noteref"><a href="#fn:mathblock" class="footnote" rel="footnote">8</a></sup><sup id="fnref:html" role="doc-noteref"><a href="#fn:html" class="footnote" rel="footnote">9</a></sup></p>
2
2
 
3
- <div class="footnotes">
3
+ <div class="footnotes" role="doc-endnotes">
4
4
  <ol>
5
- <li id="fn:paragraph">
5
+ <li id="fn:paragraph" role="doc-endnote">
6
6
 
7
- <p>A paragraph <a href="#fnref:paragraph" class="reversefootnote">&#8617;</a></p>
7
+ <p>A paragraph <a href="#fnref:paragraph" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
8
8
  </li>
9
- <li id="fn:header">
9
+ <li id="fn:header" role="doc-endnote">
10
10
 
11
- <h1 id="a-header">A header <a href="#fnref:header" class="reversefootnote">&#8617;</a></h1>
11
+ <h1 id="a-header">A header <a href="#fnref:header" class="reversefootnote" role="doc-backlink">&#8617;</a></h1>
12
12
  </li>
13
- <li id="fn:blockquote">
13
+ <li id="fn:blockquote" role="doc-endnote">
14
14
 
15
15
  <blockquote>
16
16
  <p>blockquote</p>
17
17
 
18
- <p>paragraph <a href="#fnref:blockquote" class="reversefootnote">&#8617;</a></p>
18
+ <p>paragraph <a href="#fnref:blockquote" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
19
19
  </blockquote>
20
20
  </li>
21
- <li id="fn:codeblock">
21
+ <li id="fn:codeblock" role="doc-endnote">
22
22
 
23
23
  <pre><code>codeblock
24
24
  </code></pre>
25
- <p><a href="#fnref:codeblock" class="reversefootnote">&#8617;</a></p>
25
+ <p><a href="#fnref:codeblock" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
26
26
  </li>
27
- <li id="fn:list">
27
+ <li id="fn:list" role="doc-endnote">
28
28
 
29
29
  <ul>
30
30
  <li>item 1</li>
@@ -36,14 +36,14 @@
36
36
  <blockquote>
37
37
  <p>blockquote</p>
38
38
 
39
- <h1 id="header">header <a href="#fnref:list" class="reversefootnote">&#8617;</a></h1>
39
+ <h1 id="header">header <a href="#fnref:list" class="reversefootnote" role="doc-backlink">&#8617;</a></h1>
40
40
  </blockquote>
41
41
  </li>
42
42
  </ul>
43
43
  </li>
44
44
  </ul>
45
45
  </li>
46
- <li id="fn:table">
46
+ <li id="fn:table" role="doc-endnote">
47
47
 
48
48
  <table>
49
49
  <tbody>
@@ -57,23 +57,23 @@
57
57
  </tr>
58
58
  </tbody>
59
59
  </table>
60
- <p><a href="#fnref:table" class="reversefootnote">&#8617;</a></p>
60
+ <p><a href="#fnref:table" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
61
61
  </li>
62
- <li id="fn:hrule">
62
+ <li id="fn:hrule" role="doc-endnote">
63
63
 
64
64
  <hr />
65
- <p><a href="#fnref:hrule" class="reversefootnote">&#8617;</a></p>
65
+ <p><a href="#fnref:hrule" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
66
66
  </li>
67
- <li id="fn:mathblock">
67
+ <li id="fn:mathblock" role="doc-endnote">
68
68
 
69
- <script type="math/tex; mode=display">x + 2</script>
70
- <p><a href="#fnref:mathblock" class="reversefootnote">&#8617;</a></p>
69
+ \[x + 2\]
70
+ <p><a href="#fnref:mathblock" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
71
71
  </li>
72
- <li id="fn:html">
72
+ <li id="fn:html" role="doc-endnote">
73
73
 
74
74
  <div>test
75
75
  </div>
76
- <p><a href="#fnref:html" class="reversefootnote">&#8617;</a></p>
76
+ <p><a href="#fnref:html" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
77
77
  </li>
78
78
  </ol>
79
79
  </div>
@@ -1,9 +1,9 @@
1
- <p>Some footnote here<sup id="fnref:fn"><a href="#fn:fn" class="footnote">1</a></sup></p>
1
+ <p>Some footnote here<sup id="fnref:fn" role="doc-noteref"><a href="#fn:fn" class="footnote" rel="footnote">1</a></sup></p>
2
2
 
3
- <div class="footnotes">
3
+ <div class="footnotes" role="doc-endnotes">
4
4
  <ol>
5
- <li id="fn:fn">
6
- <p>Some text here <a href="#fnref:fn" class="reversefootnote">text &8617; &lt;img /&gt;</a></p>
5
+ <li id="fn:fn" role="doc-endnote">
6
+ <p>Some text here <a href="#fnref:fn" class="reversefootnote" role="doc-backlink">text &8617; &lt;img /&gt;</a></p>
7
7
  </li>
8
8
  </ol>
9
9
  </div>
@@ -1,12 +1,12 @@
1
- <p>This is a footnote<sup id="fnref:ab"><a href="#fn:ab" class="footnote">35</a></sup>. And another<sup id="fnref:bc"><a href="#fn:bc" class="footnote">36</a></sup>.</p>
1
+ <p>This is a footnote<sup id="fnref:ab" role="doc-noteref"><a href="#fn:ab" class="footnote" rel="footnote">35</a></sup>. And another<sup id="fnref:bc" role="doc-noteref"><a href="#fn:bc" class="footnote" rel="footnote">36</a></sup>.</p>
2
2
 
3
- <div class="footnotes">
3
+ <div class="footnotes" role="doc-endnotes">
4
4
  <ol start="35">
5
- <li id="fn:ab">
6
- <p>Some text. <a href="#fnref:ab" class="reversefootnote">&#8617;</a></p>
5
+ <li id="fn:ab" role="doc-endnote">
6
+ <p>Some text. <a href="#fnref:ab" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
7
7
  </li>
8
- <li id="fn:bc">
9
- <p>Some other text. <a href="#fnref:bc" class="reversefootnote">&#8617;</a></p>
8
+ <li id="fn:bc" role="doc-endnote">
9
+ <p>Some other text. <a href="#fnref:bc" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
10
10
  </li>
11
11
  </ol>
12
12
  </div>