kramdown 1.2.0 → 1.3.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.
Potentially problematic release.
This version of kramdown might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CONTRIBUTERS +5 -1
- data/README.md +5 -1
- data/Rakefile +5 -3
- data/VERSION +1 -1
- data/benchmark/generate_data.rb +1 -1
- data/doc/default.template +2 -2
- data/doc/index.page +3 -4
- data/doc/news.feed +1 -1
- data/doc/quickref.page +4 -4
- data/doc/sidebar.template +7 -8
- data/doc/syntax.page +10 -3
- data/doc/tests.page +1 -1
- data/lib/kramdown/converter.rb +1 -0
- data/lib/kramdown/converter/base.rb +57 -9
- data/lib/kramdown/converter/kramdown.rb +4 -2
- data/lib/kramdown/converter/pdf.rb +638 -0
- data/lib/kramdown/document.rb +1 -1
- data/lib/kramdown/element.rb +4 -0
- data/lib/kramdown/options.rb +44 -8
- data/lib/kramdown/parser/base.rb +4 -2
- data/lib/kramdown/parser/gfm.rb +25 -18
- data/lib/kramdown/parser/html.rb +2 -2
- data/lib/kramdown/parser/kramdown.rb +24 -2
- data/lib/kramdown/parser/kramdown/abbreviation.rb +3 -2
- data/lib/kramdown/parser/kramdown/autolink.rb +2 -1
- data/lib/kramdown/parser/kramdown/blockquote.rb +2 -1
- data/lib/kramdown/parser/kramdown/codeblock.rb +4 -2
- data/lib/kramdown/parser/kramdown/codespan.rb +2 -1
- data/lib/kramdown/parser/kramdown/emphasis.rb +2 -1
- data/lib/kramdown/parser/kramdown/extensions.rb +5 -4
- data/lib/kramdown/parser/kramdown/footnote.rb +6 -4
- data/lib/kramdown/parser/kramdown/header.rb +4 -2
- data/lib/kramdown/parser/kramdown/horizontal_rule.rb +2 -1
- data/lib/kramdown/parser/kramdown/html_entity.rb +4 -2
- data/lib/kramdown/parser/kramdown/link.rb +3 -2
- data/lib/kramdown/parser/kramdown/list.rb +9 -5
- data/lib/kramdown/parser/kramdown/math.rb +5 -3
- data/lib/kramdown/parser/kramdown/paragraph.rb +2 -1
- data/lib/kramdown/parser/kramdown/table.rb +5 -3
- data/lib/kramdown/parser/kramdown/typographic_symbol.rb +10 -5
- data/lib/kramdown/utils.rb +1 -0
- data/lib/kramdown/utils/string_scanner.rb +52 -0
- data/lib/kramdown/version.rb +1 -1
- data/man/man1/kramdown.1 +41 -6
- data/test/test_files.rb +2 -2
- data/test/test_location.rb +158 -0
- data/test/test_string_scanner_kramdown.rb +22 -0
- data/test/testcases/block/04_header/with_auto_id_stripping.html +1 -0
- data/test/testcases/block/04_header/with_auto_id_stripping.options +1 -0
- data/test/testcases/block/04_header/with_auto_id_stripping.text +1 -0
- data/test/testcases/span/math/normal.html +2 -1
- data/test/testcases/span/math/normal.text +2 -1
- data/test/testcases_gfm/hard_line_breaks_off.html +2 -0
- data/test/testcases_gfm/hard_line_breaks_off.options +1 -0
- data/test/testcases_gfm/hard_line_breaks_off.text +2 -0
- metadata +27 -3
@@ -0,0 +1,22 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
|
3
|
+
require 'minitest/autorun'
|
4
|
+
require 'kramdown/utils/string_scanner'
|
5
|
+
|
6
|
+
describe Kramdown::Utils::StringScanner do
|
7
|
+
|
8
|
+
[
|
9
|
+
["...........X............", [/X/], 1],
|
10
|
+
["1\n2\n3\n4\n5\n6X", [/X/], 6],
|
11
|
+
["1\n2\n3\n4\n5\n6X\n7\n8X", [/X/,/X/], 8],
|
12
|
+
[(".\n" * 1000) + 'X', [/X/], 1001]
|
13
|
+
].each_with_index do |test_data, i|
|
14
|
+
test_string, scan_regexes, expect = test_data
|
15
|
+
it "computes the correct current_line_number for example ##{i+1}" do
|
16
|
+
str_sc = Kramdown::Utils::StringScanner.new(test_string)
|
17
|
+
scan_regexes.each { |scan_re| str_sc.scan_until(scan_re) }
|
18
|
+
str_sc.current_line_number.must_equal expect
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
<h1 id="this-is-a-header"><em class="none">This is a header</em></h1>
|
@@ -0,0 +1 @@
|
|
1
|
+
:auto_id_stripping: true
|
@@ -0,0 +1 @@
|
|
1
|
+
# <em class="none">This is a header</em>
|
@@ -1,4 +1,5 @@
|
|
1
|
-
<p>This is <script type="math/tex">\lambda_\alpha > 5</script> some math
|
1
|
+
<p>This is <script type="math/tex">\lambda_\alpha > 5</script> some math. With <script type="math/tex">1
|
2
|
+
+ 1</script> new line characters in between.</p>
|
2
3
|
|
3
4
|
<p><script type="math/tex">5+5</script> inline math, $5.00 $$no math$$</p>
|
4
5
|
|
@@ -0,0 +1 @@
|
|
1
|
+
:hard_wrap: false
|
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kramdown
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.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: 2013-08
|
11
|
+
date: 2013-12-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: minitest
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '5.0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '5.0'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: coderay
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -69,6 +83,7 @@ files:
|
|
69
83
|
- lib/kramdown/converter/html.rb
|
70
84
|
- lib/kramdown/converter/kramdown.rb
|
71
85
|
- lib/kramdown/converter/latex.rb
|
86
|
+
- lib/kramdown/converter/pdf.rb
|
72
87
|
- lib/kramdown/converter/remove_html_tags.rb
|
73
88
|
- lib/kramdown/converter/toc.rb
|
74
89
|
- lib/kramdown/document.rb
|
@@ -109,6 +124,7 @@ files:
|
|
109
124
|
- lib/kramdown/utils/entities.rb
|
110
125
|
- lib/kramdown/utils/html.rb
|
111
126
|
- lib/kramdown/utils/ordered_hash.rb
|
127
|
+
- lib/kramdown/utils/string_scanner.rb
|
112
128
|
- lib/kramdown/utils/unidecoder.rb
|
113
129
|
- lib/kramdown/version.rb
|
114
130
|
- man/man1/kramdown.1
|
@@ -134,6 +150,8 @@ files:
|
|
134
150
|
- doc/virtual
|
135
151
|
- test/run_tests.rb
|
136
152
|
- test/test_files.rb
|
153
|
+
- test/test_location.rb
|
154
|
+
- test/test_string_scanner_kramdown.rb
|
137
155
|
- test/testcases/block/01_blank_line/spaces.html
|
138
156
|
- test/testcases/block/01_blank_line/spaces.text
|
139
157
|
- test/testcases/block/01_blank_line/tabs.html
|
@@ -169,6 +187,9 @@ files:
|
|
169
187
|
- test/testcases/block/04_header/with_auto_id_prefix.html
|
170
188
|
- test/testcases/block/04_header/with_auto_id_prefix.options
|
171
189
|
- test/testcases/block/04_header/with_auto_id_prefix.text
|
190
|
+
- test/testcases/block/04_header/with_auto_id_stripping.html
|
191
|
+
- test/testcases/block/04_header/with_auto_id_stripping.options
|
192
|
+
- test/testcases/block/04_header/with_auto_id_stripping.text
|
172
193
|
- test/testcases/block/04_header/with_auto_ids.html
|
173
194
|
- test/testcases/block/04_header/with_auto_ids.options
|
174
195
|
- test/testcases/block/04_header/with_auto_ids.text
|
@@ -495,9 +516,12 @@ files:
|
|
495
516
|
- test/testcases_gfm/backticks_disable_highlighting.text
|
496
517
|
- test/testcases_gfm/backticks_syntax.html
|
497
518
|
- test/testcases_gfm/backticks_syntax.text
|
519
|
+
- test/testcases_gfm/hard_line_breaks_off.html
|
520
|
+
- test/testcases_gfm/hard_line_breaks_off.options
|
521
|
+
- test/testcases_gfm/hard_line_breaks_off.text
|
498
522
|
- test/testcases_gfm/two_para_hard_line_breaks.html
|
499
523
|
- test/testcases_gfm/two_para_hard_line_breaks.text
|
500
|
-
homepage: http://kramdown.
|
524
|
+
homepage: http://kramdown.gettalong.org
|
501
525
|
licenses:
|
502
526
|
- MIT
|
503
527
|
metadata: {}
|