kramdown 1.6.0 → 1.7.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.

Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTERS +4 -1
  3. data/VERSION +1 -1
  4. data/bin/kramdown +1 -1
  5. data/doc/documentation.template +1 -0
  6. data/doc/index.page +2 -2
  7. data/doc/syntax.page +5 -6
  8. data/lib/kramdown/converter.rb +4 -7
  9. data/lib/kramdown/converter/base.rb +3 -3
  10. data/lib/kramdown/converter/latex.rb +14 -2
  11. data/lib/kramdown/converter/math_engine/mathjaxnode.rb +48 -0
  12. data/lib/kramdown/converter/syntax_highlighter/coderay.rb +1 -1
  13. data/lib/kramdown/converter/syntax_highlighter/minted.rb +35 -0
  14. data/lib/kramdown/options.rb +2 -2
  15. data/lib/kramdown/parser/gfm.rb +1 -1
  16. data/lib/kramdown/parser/html.rb +2 -2
  17. data/lib/kramdown/parser/kramdown/codeblock.rb +1 -1
  18. data/lib/kramdown/parser/kramdown/link.rb +2 -1
  19. data/lib/kramdown/utils/configurable.rb +1 -1
  20. data/lib/kramdown/version.rb +1 -1
  21. data/man/man1/kramdown.1 +197 -197
  22. data/test/test_files.rb +13 -0
  23. data/test/test_location.rb +5 -0
  24. data/test/testcases/block/06_codeblock/highlighting-minted-with-opts.latex +9 -0
  25. data/test/testcases/block/06_codeblock/highlighting-minted-with-opts.options +4 -0
  26. data/test/testcases/block/06_codeblock/highlighting-minted-with-opts.text +5 -0
  27. data/test/testcases/block/06_codeblock/highlighting-minted.latex +8 -0
  28. data/test/testcases/block/06_codeblock/highlighting-minted.options +3 -0
  29. data/test/testcases/block/06_codeblock/highlighting-minted.text +4 -0
  30. data/test/testcases/block/06_codeblock/with_lang_in_fenced_block_name_with_dash.html +3 -0
  31. data/test/testcases/block/06_codeblock/with_lang_in_fenced_block_name_with_dash.options +2 -0
  32. data/test/testcases/block/06_codeblock/with_lang_in_fenced_block_name_with_dash.text +4 -0
  33. data/test/testcases/block/15_math/mathjaxnode.html.19 +27 -0
  34. data/test/testcases/block/15_math/mathjaxnode.options +1 -0
  35. data/test/testcases/block/15_math/mathjaxnode.text +1 -0
  36. data/test/testcases/block/15_math/mathjaxnode_notexhints.html.19 +23 -0
  37. data/test/testcases/block/15_math/mathjaxnode_notexhints.options +3 -0
  38. data/test/testcases/block/15_math/mathjaxnode_notexhints.text +1 -0
  39. data/test/testcases/block/15_math/mathjaxnode_semantics.html.19 +32 -0
  40. data/test/testcases/block/15_math/mathjaxnode_semantics.options +3 -0
  41. data/test/testcases/block/15_math/mathjaxnode_semantics.text +1 -0
  42. data/test/testcases/span/01_link/link_defs.html +1 -1
  43. data/test/testcases/span/01_link/link_defs.text +2 -1
  44. data/test/testcases/span/03_codespan/highlighting-minted.latex +2 -0
  45. data/test/testcases/span/03_codespan/highlighting-minted.options +1 -0
  46. data/test/testcases/span/03_codespan/highlighting-minted.text +1 -0
  47. data/test/testcases/span/math/mathjaxnode.html.19 +27 -0
  48. data/test/testcases/span/math/mathjaxnode.options +1 -0
  49. data/test/testcases/span/math/mathjaxnode.text +1 -0
  50. metadata +29 -3
@@ -57,6 +57,10 @@ class TestFiles < Minitest::Test
57
57
  'test/testcases/span/math/ritex.html', # bc of tidy
58
58
  'test/testcases/block/15_math/itex2mml.html', # bc of tidy
59
59
  'test/testcases/span/math/itex2mml.html', # bc of tidy
60
+ 'test/testcases/block/15_math/mathjaxnode.html', # bc of tidy
61
+ 'test/testcases/block/15_math/mathjaxnode_notexhints.html', # bc of tidy
62
+ 'test/testcases/block/15_math/mathjaxnode_semantics.html', # bc of tidy
63
+ 'test/testcases/span/math/mathjaxnode.html', # bc of tidy
60
64
  'test/testcases/block/15_math/mathjax_preview.html', # bc of mathjax preview
61
65
  'test/testcases/block/15_math/mathjax_preview_simple.html', # bc of mathjax preview
62
66
  ].compact
@@ -111,6 +115,7 @@ class TestFiles < Minitest::Test
111
115
  'test/testcases/span/01_link/imagelinks.text', # bc of image links
112
116
  'test/testcases/span/01_link/empty_title.text',
113
117
  'test/testcases/span/04_footnote/markers.text', # bc of footnote in header
118
+ 'test/testcases/block/06_codeblock/with_lang_in_fenced_block_name_with_dash.text',
114
119
  ].compact
115
120
  Dir[File.dirname(__FILE__) + '/testcases/**/*.text'].each do |text_file|
116
121
  next if EXCLUDE_LATEX_FILES.any? {|f| text_file =~ /#{f}$/}
@@ -154,6 +159,10 @@ class TestFiles < Minitest::Test
154
159
  'test/testcases/span/math/ritex.text', # bc of tidy
155
160
  'test/testcases/block/15_math/itex2mml.text', # bc of tidy
156
161
  'test/testcases/span/math/itex2mml.text', # bc of tidy
162
+ 'test/testcases/block/15_math/mathjaxnode.text', # bc of tidy
163
+ 'test/testcases/block/15_math/mathjaxnode_notexhints.text', # bc of tidy
164
+ 'test/testcases/block/15_math/mathjaxnode_semantics.text', # bc of tidy
165
+ 'test/testcases/span/math/mathjaxnode.text', # bc of tidy
157
166
  'test/testcases/span/01_link/link_defs_with_ial.text', # bc of attribute ordering
158
167
  ].compact
159
168
  Dir[File.dirname(__FILE__) + '/testcases/**/*.text'].each do |text_file|
@@ -196,6 +205,10 @@ class TestFiles < Minitest::Test
196
205
  'test/testcases/span/math/ritex.html', # bc of tidy
197
206
  'test/testcases/block/15_math/itex2mml.html', # bc of tidy
198
207
  'test/testcases/span/math/itex2mml.html', # bc of tidy
208
+ 'test/testcases/block/15_math/mathjaxnode.html', # bc of tidy
209
+ 'test/testcases/block/15_math/mathjaxnode_notexhints.html', # bc of tidy
210
+ 'test/testcases/block/15_math/mathjaxnode_semantics.html', # bc of tidy
211
+ 'test/testcases/span/math/mathjaxnode.html', # bc of tidy
199
212
  'test/testcases/block/15_math/mathjax_preview.html', # bc of mathjax preview
200
213
  'test/testcases/block/15_math/mathjax_preview_simple.html', # bc of mathjax preview
201
214
  'test/testcases/span/01_link/link_defs_with_ial.html', # bc of attribute ordering
@@ -169,6 +169,11 @@ describe 'location' do
169
169
  # T
170
170
  {:.line-7}
171
171
  ),
172
+ 'gh issue 243 - HTML raw elements' => %(
173
+ <ul class="line-1">
174
+ <li class="line-2">Test</li>
175
+ </ul>
176
+ ),
172
177
  }
173
178
  test_cases.each do |name, test_string|
174
179
  it "Handles #{ name }" do
@@ -0,0 +1,9 @@
1
+ \begin{minted}[breaklines,linenos]{ruby}
2
+ x = Class.new
3
+
4
+ \end{minted}
5
+
6
+ \begin{minted}[breaklines,linenos]{html}
7
+ <a>this is a reaally, reaally, reaally, reaally, reaally, reaally, reaally, reaally, reaally, reaally, reaally, long link</a>
8
+
9
+ \end{minted}
@@ -0,0 +1,4 @@
1
+ :syntax_highlighter: minted
2
+ :syntax_highlighter_opts:
3
+ wrap: true
4
+ line_numbers: true
@@ -0,0 +1,5 @@
1
+ x = Class.new
2
+ {: .language-ruby}
3
+
4
+ <a>this is a reaally, reaally, reaally, reaally, reaally, reaally, reaally, reaally, reaally, reaally, reaally, long link</a>
5
+ {: .language-html}
@@ -0,0 +1,8 @@
1
+ \begin{minted}[]{ruby}
2
+ x = Class.new
3
+
4
+ \end{minted}
5
+ \begin{minted}[]{html}
6
+ <a>href</a>
7
+
8
+ \end{minted}
@@ -0,0 +1,3 @@
1
+ :syntax_highlighter: minted
2
+ :syntax_highlighter_opts:
3
+ default_lang: ruby
@@ -0,0 +1,4 @@
1
+ x = Class.new
2
+ ^
3
+ <a>href</a>
4
+ {: .language-html}
@@ -0,0 +1,3 @@
1
+ <pre><code class="language-act-iii">s1'dim'a'500'm'500'q'500''
2
+ index'j'j+1'j-1''
3
+ </code></pre>
@@ -0,0 +1,4 @@
1
+ ~~~ act-iii
2
+ s1'dim'a'500'm'500'q'500''
3
+ index'j'j+1'j-1''
4
+ ~~~
@@ -0,0 +1,27 @@
1
+ <math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
2
+ <mi>f</mi>
3
+ <mo stretchy="false">(</mo>
4
+ <mi>x</mi>
5
+ <mo stretchy="false">)</mo>
6
+ <mo>=</mo>
7
+ <mi>a</mi>
8
+ <mrow class="MJX-TeXAtom-ORD">
9
+ <msup>
10
+ <mi>x</mi>
11
+ <mn>3</mn>
12
+ </msup>
13
+ </mrow>
14
+ <mo>+</mo>
15
+ <mi>b</mi>
16
+ <mrow class="MJX-TeXAtom-ORD">
17
+ <msup>
18
+ <mi>x</mi>
19
+ <mn>2</mn>
20
+ </msup>
21
+ </mrow>
22
+ <mo>+</mo>
23
+ <mi>c</mi>
24
+ <mi>x</mi>
25
+ <mo>+</mo>
26
+ <mi>d</mi>
27
+ </math>
@@ -0,0 +1 @@
1
+ :math_engine: mathjaxnode
@@ -0,0 +1 @@
1
+ $$f(x) = a{x^3} + b{x^2} + cx + d$$
@@ -0,0 +1,23 @@
1
+ <math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
2
+ <mi>f</mi>
3
+ <mo stretchy="false">(</mo>
4
+ <mi>x</mi>
5
+ <mo stretchy="false">)</mo>
6
+ <mo>=</mo>
7
+ <mi>a</mi>
8
+ <msup>
9
+ <mi>x</mi>
10
+ <mn>3</mn>
11
+ </msup>
12
+ <mo>+</mo>
13
+ <mi>b</mi>
14
+ <msup>
15
+ <mi>x</mi>
16
+ <mn>2</mn>
17
+ </msup>
18
+ <mo>+</mo>
19
+ <mi>c</mi>
20
+ <mi>x</mi>
21
+ <mo>+</mo>
22
+ <mi>d</mi>
23
+ </math>
@@ -0,0 +1,3 @@
1
+ :math_engine: mathjaxnode
2
+ :math_engine_opts:
3
+ :texhints: false
@@ -0,0 +1 @@
1
+ $$f(x) = a{x^3} + b{x^2} + cx + d$$
@@ -0,0 +1,32 @@
1
+ <math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
2
+ <semantics>
3
+ <mrow>
4
+ <mi>f</mi>
5
+ <mo stretchy="false">(</mo>
6
+ <mi>x</mi>
7
+ <mo stretchy="false">)</mo>
8
+ <mo>=</mo>
9
+ <mi>a</mi>
10
+ <mrow class="MJX-TeXAtom-ORD">
11
+ <msup>
12
+ <mi>x</mi>
13
+ <mn>3</mn>
14
+ </msup>
15
+ </mrow>
16
+ <mo>+</mo>
17
+ <mi>b</mi>
18
+ <mrow class="MJX-TeXAtom-ORD">
19
+ <msup>
20
+ <mi>x</mi>
21
+ <mn>2</mn>
22
+ </msup>
23
+ </mrow>
24
+ <mo>+</mo>
25
+ <mi>c</mi>
26
+ <mi>x</mi>
27
+ <mo>+</mo>
28
+ <mi>d</mi>
29
+ </mrow>
30
+ <annotation encoding="application/x-tex">f(x) = a{x^3} + b{x^2} + cx + d</annotation>
31
+ </semantics>
32
+ </math>
@@ -0,0 +1,3 @@
1
+ :math_engine: mathjaxnode
2
+ :math_engine_opts:
3
+ :semantics: true
@@ -0,0 +1 @@
1
+ $$f(x) = a{x^3} + b{x^2} + cx + d$$
@@ -6,4 +6,4 @@
6
6
 
7
7
  <p>Points to <a href="one.url">1</a> and <a href="two.url">2</a> and <a href="three.url">3</a> but not [4]</p>
8
8
 
9
- <p>Points to <a href="http://example.com">_.:,;!?-</a></p>
9
+ <p>Points to <a href="http://example.com">_.:,;!?-</a> and <a href="test.html#'test'" title="title">otherid8</a></p>
@@ -9,6 +9,7 @@ This is a para.
9
9
  [otherid6]: some spaces.html 'title'
10
10
  [otherid7]: some spaces
11
11
  "title"
12
+ [otherid8]:test.html#'test' 'title'
12
13
 
13
14
  [break]: http://www.example.com/test/asdf.html
14
15
  'Another title'
@@ -23,4 +24,4 @@ Points to [1] and [2] and [3] but not [4]
23
24
 
24
25
  [_.:,;!?-]: http://example.com
25
26
 
26
- Points to [_.:,;!?-]
27
+ Points to [_.:,;!?-] and [otherid8]
@@ -0,0 +1,2 @@
1
+ You can say \mintinline{ruby}{x = Class.new}, for example.
2
+
@@ -0,0 +1 @@
1
+ :syntax_highlighter: minted
@@ -0,0 +1 @@
1
+ You can say `x = Class.new`{:.language-ruby}, for example.
@@ -0,0 +1,27 @@
1
+ <p>This is <math xmlns="http://www.w3.org/1998/Math/MathML">
2
+ <mi>f</mi>
3
+ <mo stretchy="false">(</mo>
4
+ <mi>x</mi>
5
+ <mo stretchy="false">)</mo>
6
+ <mo>=</mo>
7
+ <mi>a</mi>
8
+ <mrow class="MJX-TeXAtom-ORD">
9
+ <msup>
10
+ <mi>x</mi>
11
+ <mn>3</mn>
12
+ </msup>
13
+ </mrow>
14
+ <mo>+</mo>
15
+ <mi>b</mi>
16
+ <mrow class="MJX-TeXAtom-ORD">
17
+ <msup>
18
+ <mi>x</mi>
19
+ <mn>2</mn>
20
+ </msup>
21
+ </mrow>
22
+ <mo>+</mo>
23
+ <mi>c</mi>
24
+ <mi>x</mi>
25
+ <mo>+</mo>
26
+ <mi>d</mi>
27
+ </math> something!</p>
@@ -0,0 +1 @@
1
+ :math_engine: mathjaxnode
@@ -0,0 +1 @@
1
+ This is $$f(x) = a{x^3} + b{x^2} + cx + d$$ something!
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kramdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Leitner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-28 00:00:00.000000000 Z
11
+ date: 2015-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -161,11 +161,13 @@ files:
161
161
  - lib/kramdown/converter/latex.rb
162
162
  - lib/kramdown/converter/math_engine/itex2mml.rb
163
163
  - lib/kramdown/converter/math_engine/mathjax.rb
164
+ - lib/kramdown/converter/math_engine/mathjaxnode.rb
164
165
  - lib/kramdown/converter/math_engine/ritex.rb
165
166
  - lib/kramdown/converter/pdf.rb
166
167
  - lib/kramdown/converter/remove_html_tags.rb
167
168
  - lib/kramdown/converter/syntax_highlighter.rb
168
169
  - lib/kramdown/converter/syntax_highlighter/coderay.rb
170
+ - lib/kramdown/converter/syntax_highlighter/minted.rb
169
171
  - lib/kramdown/converter/syntax_highlighter/rouge.rb
170
172
  - lib/kramdown/converter/toc.rb
171
173
  - lib/kramdown/document.rb
@@ -274,6 +276,12 @@ files:
274
276
  - test/testcases/block/06_codeblock/disable-highlighting.text
275
277
  - test/testcases/block/06_codeblock/error.html
276
278
  - test/testcases/block/06_codeblock/error.text
279
+ - test/testcases/block/06_codeblock/highlighting-minted-with-opts.latex
280
+ - test/testcases/block/06_codeblock/highlighting-minted-with-opts.options
281
+ - test/testcases/block/06_codeblock/highlighting-minted-with-opts.text
282
+ - test/testcases/block/06_codeblock/highlighting-minted.latex
283
+ - test/testcases/block/06_codeblock/highlighting-minted.options
284
+ - test/testcases/block/06_codeblock/highlighting-minted.text
277
285
  - test/testcases/block/06_codeblock/highlighting-opts.html
278
286
  - test/testcases/block/06_codeblock/highlighting-opts.options
279
287
  - test/testcases/block/06_codeblock/highlighting-opts.text
@@ -306,6 +314,9 @@ files:
306
314
  - test/testcases/block/06_codeblock/with_lang_in_fenced_block.html
307
315
  - test/testcases/block/06_codeblock/with_lang_in_fenced_block.options
308
316
  - test/testcases/block/06_codeblock/with_lang_in_fenced_block.text
317
+ - test/testcases/block/06_codeblock/with_lang_in_fenced_block_name_with_dash.html
318
+ - test/testcases/block/06_codeblock/with_lang_in_fenced_block_name_with_dash.options
319
+ - test/testcases/block/06_codeblock/with_lang_in_fenced_block_name_with_dash.text
309
320
  - test/testcases/block/07_horizontal_rule/error.html
310
321
  - test/testcases/block/07_horizontal_rule/error.html.19
311
322
  - test/testcases/block/07_horizontal_rule/error.text
@@ -482,6 +493,15 @@ files:
482
493
  - test/testcases/block/15_math/mathjax_preview_simple.html
483
494
  - test/testcases/block/15_math/mathjax_preview_simple.options
484
495
  - test/testcases/block/15_math/mathjax_preview_simple.text
496
+ - test/testcases/block/15_math/mathjaxnode.html.19
497
+ - test/testcases/block/15_math/mathjaxnode.options
498
+ - test/testcases/block/15_math/mathjaxnode.text
499
+ - test/testcases/block/15_math/mathjaxnode_notexhints.html.19
500
+ - test/testcases/block/15_math/mathjaxnode_notexhints.options
501
+ - test/testcases/block/15_math/mathjaxnode_notexhints.text
502
+ - test/testcases/block/15_math/mathjaxnode_semantics.html.19
503
+ - test/testcases/block/15_math/mathjaxnode_semantics.options
504
+ - test/testcases/block/15_math/mathjaxnode_semantics.text
485
505
  - test/testcases/block/15_math/normal.html
486
506
  - test/testcases/block/15_math/normal.text
487
507
  - test/testcases/block/15_math/ritex.html
@@ -533,6 +553,9 @@ files:
533
553
  - test/testcases/span/03_codespan/empty.text
534
554
  - test/testcases/span/03_codespan/errors.html
535
555
  - test/testcases/span/03_codespan/errors.text
556
+ - test/testcases/span/03_codespan/highlighting-minted.latex
557
+ - test/testcases/span/03_codespan/highlighting-minted.options
558
+ - test/testcases/span/03_codespan/highlighting-minted.text
536
559
  - test/testcases/span/03_codespan/highlighting-rouge.html
537
560
  - test/testcases/span/03_codespan/highlighting-rouge.options
538
561
  - test/testcases/span/03_codespan/highlighting-rouge.text
@@ -592,6 +615,9 @@ files:
592
615
  - test/testcases/span/math/itex2mml.html
593
616
  - test/testcases/span/math/itex2mml.options
594
617
  - test/testcases/span/math/itex2mml.text
618
+ - test/testcases/span/math/mathjaxnode.html.19
619
+ - test/testcases/span/math/mathjaxnode.options
620
+ - test/testcases/span/math/mathjaxnode.text
595
621
  - test/testcases/span/math/normal.html
596
622
  - test/testcases/span/math/normal.text
597
623
  - test/testcases/span/math/ritex.html
@@ -656,7 +682,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
656
682
  version: '0'
657
683
  requirements: []
658
684
  rubyforge_project:
659
- rubygems_version: 2.2.2
685
+ rubygems_version: 2.4.6
660
686
  signing_key:
661
687
  specification_version: 4
662
688
  summary: kramdown is a fast, pure-Ruby Markdown-superset converter.