kramdown 0.13.7 → 0.13.8
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.
- data/CONTRIBUTERS +5 -1
- data/ChangeLog +225 -0
- data/README.md +50 -0
- data/Rakefile +6 -5
- data/VERSION +1 -1
- data/doc/default.template +1 -1
- data/doc/sidebar.template +2 -2
- data/lib/kramdown/converter/base.rb +7 -0
- data/lib/kramdown/converter/html.rb +9 -6
- data/lib/kramdown/converter/kramdown.rb +4 -3
- data/lib/kramdown/converter/latex.rb +1 -1
- data/lib/kramdown/document.rb +29 -0
- data/lib/kramdown/options.rb +23 -2
- data/lib/kramdown/parser/kramdown/abbreviation.rb +2 -1
- data/lib/kramdown/version.rb +1 -1
- data/man/man1/kramdown.1 +142 -117
- data/test/test_files.rb +13 -2
- data/test/testcases/block/04_header/header_type_offset.html +11 -0
- data/test/testcases/block/04_header/header_type_offset.kramdown +12 -0
- data/test/testcases/block/04_header/header_type_offset.latex +12 -0
- data/test/testcases/block/04_header/header_type_offset.options +2 -0
- data/test/testcases/block/04_header/header_type_offset.text +13 -0
- data/test/testcases/block/06_codeblock/disable-highlighting.html +4 -0
- data/test/testcases/block/06_codeblock/disable-highlighting.options +1 -0
- data/test/testcases/block/06_codeblock/disable-highlighting.text +4 -0
- data/test/testcases/span/abbreviations/abbrev.html +2 -2
- data/test/testcases/span/abbreviations/abbrev.text +5 -2
- data/test/testcases/span/autolinks/url_links.html +2 -0
- data/test/testcases/span/autolinks/url_links.text +3 -0
- metadata +45 -53
- data/README +0 -43
data/test/test_files.rb
CHANGED
@@ -55,12 +55,17 @@ class TestFiles < Test::Unit::TestCase
|
|
55
55
|
EXCLUDE_HTML_FILES = ['test/testcases/block/06_codeblock/whitespace.html', # bc of span inside pre
|
56
56
|
'test/testcases/block/09_html/simple.html', # bc of xml elements
|
57
57
|
'test/testcases/span/03_codespan/highlighting.html', # bc of span elements inside code element
|
58
|
+
'test/testcases/block/04_header/with_auto_ids.html', # bc of auto_ids=true option
|
59
|
+
'test/testcases/block/04_header/header_type_offset.html', # bc of header_offset option
|
58
60
|
]
|
59
61
|
Dir[File.dirname(__FILE__) + '/testcases/**/*.{html, htmlinput}'].each do |html_file|
|
60
62
|
next if EXCLUDE_HTML_FILES.any? {|f| html_file =~ /#{f}$/}
|
61
63
|
out_file = (html_file =~ /\.htmlinput$/ ? html_file.sub(/input$/, '') : html_file)
|
62
64
|
define_method('test_' + html_file.tr('.', '_') + "_to_html") do
|
63
|
-
|
65
|
+
opts_file = html_file.sub(/\.html$/, '.options')
|
66
|
+
opts_file = File.join(File.dirname(html_file), 'options') if !File.exist?(opts_file)
|
67
|
+
options = File.exist?(opts_file) ? YAML::load(File.read(opts_file)) : {:auto_ids => false, :footnote_nr => 1}
|
68
|
+
doc = Kramdown::Document.new(File.read(html_file), options.merge(:input => 'html'))
|
64
69
|
assert_equal(tidy_output(File.read(out_file)), tidy_output(doc.to_html))
|
65
70
|
end
|
66
71
|
end
|
@@ -119,6 +124,7 @@ class TestFiles < Test::Unit::TestCase
|
|
119
124
|
'test/testcases/block/09_html/simple.text', # bc of webgen:block elements
|
120
125
|
'test/testcases/block/11_ial/simple.text', # bc of change of ordering of attributes in header
|
121
126
|
'test/testcases/span/extension/comment.text', # bc of comment text modifications (can this be avoided?)
|
127
|
+
'test/testcases/block/04_header/header_type_offset.text', # bc of header_offset being applied twice
|
122
128
|
]
|
123
129
|
Dir[File.dirname(__FILE__) + '/testcases/**/*.text'].each do |text_file|
|
124
130
|
next if EXCLUDE_TEXT_FILES.any? {|f| text_file =~ /#{f}$/}
|
@@ -149,12 +155,17 @@ class TestFiles < Test::Unit::TestCase
|
|
149
155
|
'test/testcases/block/06_codeblock/whitespace.html', # bc of entity to char conversion
|
150
156
|
'test/testcases/block/11_ial/simple.html', # bc of change of ordering of attributes in header
|
151
157
|
'test/testcases/span/03_codespan/highlighting.html', # bc of span elements inside code element
|
158
|
+
'test/testcases/block/04_header/with_auto_ids.html', # bc of auto_ids=true option
|
159
|
+
'test/testcases/block/04_header/header_type_offset.html', # bc of header_offset option
|
152
160
|
]
|
153
161
|
Dir[File.dirname(__FILE__) + '/testcases/**/*.html'].each do |html_file|
|
154
162
|
next if EXCLUDE_HTML_KD_FILES.any? {|f| html_file =~ /#{f}$/}
|
155
163
|
define_method('test_' + html_file.tr('.', '_') + "_to_kramdown_to_html") do
|
156
164
|
kd = Kramdown::Document.new(File.read(html_file), :input => 'html', :auto_ids => false, :footnote_nr => 1).to_kramdown
|
157
|
-
|
165
|
+
opts_file = html_file.sub(/\.html$/, '.options')
|
166
|
+
opts_file = File.join(File.dirname(html_file), 'options') if !File.exist?(opts_file)
|
167
|
+
options = File.exist?(opts_file) ? YAML::load(File.read(opts_file)) : {:auto_ids => false, :footnote_nr => 1}
|
168
|
+
doc = Kramdown::Document.new(kd, options)
|
158
169
|
assert_equal(tidy_output(File.read(html_file)), tidy_output(doc.to_html))
|
159
170
|
end
|
160
171
|
end
|
@@ -0,0 +1 @@
|
|
1
|
+
:enable_coderay: false
|
@@ -1,8 +1,8 @@
|
|
1
1
|
<p>This <abbr title="It is, yes">is some</abbr> text.</p>
|
2
2
|
|
3
|
-
<p>There <em><abbr title="It is, yes">is some</abbr> real</em> concern about <abbr title="
|
3
|
+
<p>There <em><abbr title="It is, yes">is some</abbr> real</em> concern about <abbr title="This & that">OtHeR!</abbr></p>
|
4
4
|
|
5
|
-
<p><abbr title="It is, yes">is some</abbr> Think <abbr>empty</abbr> about <abbr title="Very nice country">Österreich</abbr
|
5
|
+
<p><abbr title="It is, yes">is some</abbr> Think <abbr>empty</abbr> about <abbr title="Very nice country">Österreich</abbr>. <abbr title="Cascading">CSS</abbr> und <abbr title="Cascading 3">CSS3</abbr></p>
|
6
6
|
|
7
7
|
<p>no abbrev here because there is someone and kulis some</p>
|
8
8
|
|
@@ -1,15 +1,18 @@
|
|
1
1
|
This is some text.
|
2
2
|
|
3
3
|
*[is some]: Yes it is
|
4
|
-
*[OtHeR!]:
|
4
|
+
*[OtHeR!]: This & that
|
5
5
|
|
6
6
|
*[is some]: It is, yes
|
7
7
|
*[empty]:
|
8
8
|
|
9
9
|
There *is some real* concern about OtHeR!
|
10
10
|
|
11
|
-
is some Think empty about Österreich.
|
11
|
+
is some Think empty about Österreich. CSS und CSS3
|
12
12
|
|
13
13
|
no abbrev here because there is someone and kulis some
|
14
14
|
|
15
15
|
*[Österreich]: Very nice country
|
16
|
+
|
17
|
+
*[CSS]: Cascading
|
18
|
+
*[CSS3]: Cascading 3
|
@@ -1,6 +1,7 @@
|
|
1
1
|
<p>This should be a <a href="http://www.example.com/">http://www.example.com/</a> link.
|
2
2
|
This should be a <a href="mailto:john.doe@example.com">john.doe@example.com</a> link.
|
3
3
|
As should <a href="mailto:john.doe@example.com">john.doe@example.com</a> this.
|
4
|
+
As should <a href="mailto:CSS@example.com"><abbr title="Cascading">CSS</abbr>@example.com</a> this.
|
4
5
|
Another ampersand <a href="http://www.example.com/?doit&x=y">http://www.example.com/?doit&x=y</a> link.
|
5
6
|
More entities <a href="http://www.example.com/?doit&x="y&z=y">http://www.example.com/?doit&x="y&z=y</a>.</p>
|
6
7
|
|
@@ -10,3 +11,4 @@ Email invalid: <<a href="mailtos:me@example.com">me@example.com</a>></p>
|
|
10
11
|
<p>Autolink with underscore: <a href="http://www.example.com/with_under_score">http://www.example.com/with_under_score</a></p>
|
11
12
|
|
12
13
|
<p><a href="http://www.example.com/">http://www.example.com/</a></p>
|
14
|
+
|
@@ -1,6 +1,7 @@
|
|
1
1
|
This should be a <http://www.example.com/> link.
|
2
2
|
This should be a <mailto:john.doe@example.com> link.
|
3
3
|
As should <john.doe@example.com> this.
|
4
|
+
As should <CSS@example.com> this.
|
4
5
|
Another ampersand <http://www.example.com/?doit&x=y> link.
|
5
6
|
More entities <http://www.example.com/?doit&x="y&z=y>.
|
6
7
|
|
@@ -10,3 +11,5 @@ Email invalid: <[me@example.com](mailtos:me@example.com)>
|
|
10
11
|
Autolink with underscore: <http://www.example.com/with_under_score>
|
11
12
|
|
12
13
|
<http://www.example.com/>
|
14
|
+
|
15
|
+
*[CSS]: Cascading
|
metadata
CHANGED
@@ -1,55 +1,48 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: kramdown
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.13.8
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 13
|
9
|
-
- 7
|
10
|
-
version: 0.13.7
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Thomas Leitner
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2012-08-31 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
21
15
|
name: coderay
|
22
|
-
|
23
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
24
17
|
none: false
|
25
|
-
requirements:
|
18
|
+
requirements:
|
26
19
|
- - ~>
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
hash: 23
|
29
|
-
segments:
|
30
|
-
- 1
|
31
|
-
- 0
|
32
|
-
- 0
|
20
|
+
- !ruby/object:Gem::Version
|
33
21
|
version: 1.0.0
|
34
22
|
type: :development
|
35
|
-
|
36
|
-
|
37
|
-
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 1.0.0
|
30
|
+
description: ! 'kramdown is yet-another-markdown-parser but fast, pure Ruby,
|
31
|
+
|
38
32
|
using a strict syntax definition and supporting several common extensions.
|
39
33
|
|
34
|
+
'
|
40
35
|
email: t_leitner@gmx.at
|
41
|
-
executables:
|
36
|
+
executables:
|
42
37
|
- kramdown
|
43
38
|
extensions: []
|
44
|
-
|
45
|
-
|
46
|
-
- README
|
47
|
-
files:
|
39
|
+
extra_rdoc_files: []
|
40
|
+
files:
|
48
41
|
- Rakefile
|
49
42
|
- setup.rb
|
50
43
|
- COPYING
|
51
44
|
- GPL
|
52
|
-
- README
|
45
|
+
- README.md
|
53
46
|
- AUTHORS
|
54
47
|
- VERSION
|
55
48
|
- ChangeLog
|
@@ -361,7 +354,9 @@ files:
|
|
361
354
|
- test/testcases/block/04_header/with_auto_id_prefix.text
|
362
355
|
- test/testcases/block/04_header/atx_header.text
|
363
356
|
- test/testcases/block/04_header/with_auto_id_prefix.options
|
357
|
+
- test/testcases/block/04_header/header_type_offset.text
|
364
358
|
- test/testcases/block/04_header/atx_header.html
|
359
|
+
- test/testcases/block/04_header/header_type_offset.kramdown
|
365
360
|
- test/testcases/block/04_header/setext_header_no_newline_at_end.text
|
366
361
|
- test/testcases/block/04_header/setext_header.html.19
|
367
362
|
- test/testcases/block/04_header/atx_header_no_newline_at_end.text
|
@@ -371,8 +366,11 @@ files:
|
|
371
366
|
- test/testcases/block/04_header/with_auto_ids.text
|
372
367
|
- test/testcases/block/04_header/setext_header_no_newline_at_end.html
|
373
368
|
- test/testcases/block/04_header/with_auto_ids.html
|
369
|
+
- test/testcases/block/04_header/header_type_offset.html
|
370
|
+
- test/testcases/block/04_header/header_type_offset.latex
|
374
371
|
- test/testcases/block/04_header/atx_header_no_newline_at_end.html
|
375
372
|
- test/testcases/block/04_header/setext_header.text
|
373
|
+
- test/testcases/block/04_header/header_type_offset.options
|
376
374
|
- test/testcases/block/02_eob/middle.html
|
377
375
|
- test/testcases/block/02_eob/end.html
|
378
376
|
- test/testcases/block/02_eob/beginning.text
|
@@ -444,11 +442,13 @@ files:
|
|
444
442
|
- test/testcases/block/06_codeblock/highlighting.html
|
445
443
|
- test/testcases/block/06_codeblock/highlighting.options
|
446
444
|
- test/testcases/block/06_codeblock/whitespace.text
|
445
|
+
- test/testcases/block/06_codeblock/disable-highlighting.text
|
447
446
|
- test/testcases/block/06_codeblock/with_eob_marker.text
|
448
447
|
- test/testcases/block/06_codeblock/tilde_syntax.html
|
449
448
|
- test/testcases/block/06_codeblock/no_newline_at_end_1.text
|
450
449
|
- test/testcases/block/06_codeblock/lazy.html
|
451
450
|
- test/testcases/block/06_codeblock/with_blank_line.html
|
451
|
+
- test/testcases/block/06_codeblock/disable-highlighting.html
|
452
452
|
- test/testcases/block/06_codeblock/tilde_syntax.text
|
453
453
|
- test/testcases/block/06_codeblock/with_ial.text
|
454
454
|
- test/testcases/block/06_codeblock/normal.html
|
@@ -457,6 +457,7 @@ files:
|
|
457
457
|
- test/testcases/block/06_codeblock/with_blank_line.text
|
458
458
|
- test/testcases/block/06_codeblock/with_ial.html
|
459
459
|
- test/testcases/block/06_codeblock/no_newline_at_end_1.html
|
460
|
+
- test/testcases/block/06_codeblock/disable-highlighting.options
|
460
461
|
- test/testcases/block/06_codeblock/error.html
|
461
462
|
- test/testcases/block/06_codeblock/lazy.text
|
462
463
|
- test/testcases/block/06_codeblock/highlighting.text
|
@@ -468,37 +469,28 @@ files:
|
|
468
469
|
- test/test_files.rb
|
469
470
|
homepage: http://kramdown.rubyforge.org
|
470
471
|
licenses: []
|
471
|
-
|
472
472
|
post_install_message:
|
473
|
-
rdoc_options:
|
473
|
+
rdoc_options:
|
474
474
|
- --main
|
475
|
-
-
|
476
|
-
require_paths:
|
475
|
+
- lib/kramdown/document.rb
|
476
|
+
require_paths:
|
477
477
|
- lib
|
478
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
478
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
479
479
|
none: false
|
480
|
-
requirements:
|
481
|
-
- -
|
482
|
-
- !ruby/object:Gem::Version
|
483
|
-
|
484
|
-
|
485
|
-
- 0
|
486
|
-
version: "0"
|
487
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
480
|
+
requirements:
|
481
|
+
- - ! '>='
|
482
|
+
- !ruby/object:Gem::Version
|
483
|
+
version: '0'
|
484
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
488
485
|
none: false
|
489
|
-
requirements:
|
490
|
-
- -
|
491
|
-
- !ruby/object:Gem::Version
|
492
|
-
|
493
|
-
segments:
|
494
|
-
- 0
|
495
|
-
version: "0"
|
486
|
+
requirements:
|
487
|
+
- - ! '>='
|
488
|
+
- !ruby/object:Gem::Version
|
489
|
+
version: '0'
|
496
490
|
requirements: []
|
497
|
-
|
498
491
|
rubyforge_project: kramdown
|
499
492
|
rubygems_version: 1.8.24
|
500
493
|
signing_key:
|
501
494
|
specification_version: 3
|
502
495
|
summary: kramdown is a fast, pure-Ruby Markdown-superset converter.
|
503
496
|
test_files: []
|
504
|
-
|
data/README
DELETED
@@ -1,43 +0,0 @@
|
|
1
|
-
= kramdown
|
2
|
-
|
3
|
-
kramdown is yet-another-markdown-parser but fast, pure Ruby, using a strict syntax definition and
|
4
|
-
supporting several common extensions. The syntax definition for the kramdown syntax can be found in
|
5
|
-
doc/syntax.page and a quick reference is available in doc/quickref.page.
|
6
|
-
|
7
|
-
The kramdown library is mainly written to support the kramdown-to-HTML conversion chain. However,
|
8
|
-
due to its flexibility it supports other input and output formats as well. Here is a list of the
|
9
|
-
supported formats:
|
10
|
-
|
11
|
-
* input formats: kramdown (a Markdown superset), Markdown, HTML
|
12
|
-
* output formats: HTML, kramdown, LaTeX (and therefore PDF)
|
13
|
-
|
14
|
-
All the documentation on the available input and output formats is available in the doc/ directory
|
15
|
-
and online at http://kramdown.rubyforge.org.
|
16
|
-
|
17
|
-
|
18
|
-
== Usage
|
19
|
-
|
20
|
-
kramdown has a basic *Cloth API, so using kramdown is as easy as
|
21
|
-
|
22
|
-
require 'kramdown'
|
23
|
-
|
24
|
-
Kramdown::Document.new(text).to_html
|
25
|
-
|
26
|
-
For detailed information have a look at the API documentation of the Kramdown::Document class.
|
27
|
-
|
28
|
-
The full API documentation is available at http://kramdown.rubyforge.org/rdoc/, other sites with an
|
29
|
-
API documentation for kramdown probably don't provide the complete documentation!
|
30
|
-
|
31
|
-
|
32
|
-
== Development
|
33
|
-
|
34
|
-
Just clone the git repository as described in doc/installation.page and you are good to go. You
|
35
|
-
probably want to install `rake` so that you can use the provided rake tasks. Aside from that:
|
36
|
-
|
37
|
-
* The +tidy+ binary needs to be installed for the automatically derived tests to work.
|
38
|
-
* The +latex+ binary needs to be installed for the latex-compilation tests to work.
|
39
|
-
|
40
|
-
|
41
|
-
== License
|
42
|
-
|
43
|
-
GPLv3 - see the COPYING file.
|