kramdown 1.13.2 → 1.14.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.
- checksums.yaml +4 -4
- data/CONTRIBUTERS +5 -1
- data/README.md +2 -2
- data/VERSION +1 -1
- data/benchmark/benchmark.sh +10 -10
- data/doc/default.scss +25 -0
- data/doc/documentation.template +4 -0
- data/doc/index.page +6 -2
- data/doc/quickref.page +5 -1
- data/doc/sidebar.template +8 -2
- data/doc/syntax.page +4 -0
- data/lib/kramdown/converter.rb +1 -0
- data/lib/kramdown/converter/base.rb +1 -1
- data/lib/kramdown/converter/hash_ast.rb +2 -0
- data/lib/kramdown/converter/syntax_highlighter/rouge.rb +10 -2
- data/lib/kramdown/parser/gfm.rb +7 -1
- data/lib/kramdown/version.rb +1 -1
- data/test/test_files.rb +7 -1
- data/test/testcases_gfm/header_ids.html +1 -1
- data/test/testcases_gfm/header_ids.html.19 +1 -1
- data/test/testcases_gfm/header_ids.text +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f25c643525687184c1434ee51de53d28b8237de4
|
4
|
+
data.tar.gz: a9c68da82ab28b9bdacca96b9e514be75074eb95
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94d832f8a619061f2f640678aad4411bf9551443ccc048bf21e10a2f568488c009598eef54b4898c2cda2ff86cd55db4c9112d9468a8be9ffa2d87d02ad3e6d0
|
7
|
+
data.tar.gz: 4171a7226bf13985a08886f8af41073aad599bb09db839d3c7481b77399106e46048f41240c893a6f79b16053a08545bf890b1373d43517ef181e5faa76ea906
|
data/CONTRIBUTERS
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Count Name
|
2
2
|
======= ====
|
3
|
-
|
3
|
+
847 Thomas Leitner <t_leitner@gmx.at>
|
4
4
|
6 Gioele Barabucci <gioele@svario.it>
|
5
5
|
4 Ted Pak <powerpak006@gmail.com>
|
6
6
|
4 Shuanglei Tao <tsl0922@gmail.com>
|
@@ -17,6 +17,7 @@
|
|
17
17
|
2 Jo Hund <jhund@clearcove.ca>
|
18
18
|
2 Bran <m.versum@gmail.com>
|
19
19
|
1 winniehell <git@winniehell.de>
|
20
|
+
1 William <suttonwilliamd@gmail.com>
|
20
21
|
1 utenmiki <utenmiki@gmail.com>
|
21
22
|
1 Trevor Wennblom <trevor@well.com>
|
22
23
|
1 tomykaira <tomykaira@gmail.com>
|
@@ -32,13 +33,16 @@
|
|
32
33
|
1 myqlarson <myqlarson@gmail.com>
|
33
34
|
1 Michal Till <michal.till@gmail.com>
|
34
35
|
1 Matt Hickford <matt.hickford@gmail.com>
|
36
|
+
1 Martyn Chamberlin <martyn@perfectioncoding.com>
|
35
37
|
1 Marek Tuchowski <marek@tuchowski.com.pl>
|
36
38
|
1 Marcus Stollsteimer <sto.mar@web.de>
|
37
39
|
1 Luca Barbato <luca.barbato@gmail.com>
|
38
40
|
1 l3kn <hello@l3kn.de>
|
41
|
+
1 Jonathan Hooper <jonathan.hooper@gsa.gov>
|
39
42
|
1 John Croisant <jacius@gmail.com>
|
40
43
|
1 Joe Fiorini <joe@faithfulgeek.org>
|
41
44
|
1 Jens Kraemer <jk@jkraemer.net>
|
45
|
+
1 Hirofumi Wakasugi <baenej@gmail.com>
|
42
46
|
1 Hector Correa <hector@hectorcorrea.com>
|
43
47
|
1 Florian Klampfer <f.klampfer@gmail.com>
|
44
48
|
1 Floreal Morandat florealm@gmail.com <florealm@gmail.com>
|
data/README.md
CHANGED
@@ -7,8 +7,8 @@ requests it is now released under the MIT license and therefore can easily be us
|
|
7
7
|
projects, too.
|
8
8
|
|
9
9
|
However, if you use kramdown in a commercial setting, please consider **contributing back any
|
10
|
-
changes** for the benefit of the community and/or
|
11
|
-
|
10
|
+
changes** for the benefit of the community and/or
|
11
|
+
[**becoming a patron**](https://www.patreon.com/gettalong) - thanks!
|
12
12
|
|
13
13
|
|
14
14
|
## Introduction
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.14.0
|
data/benchmark/benchmark.sh
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#!/bin/bash
|
2
2
|
|
3
|
-
source ~/.
|
3
|
+
source ~/.profile
|
4
4
|
|
5
5
|
RUBY_VERSIONS=`rvm list strings | sort`
|
6
6
|
KD_VERSIONS="`git tag | sort -V` master"
|
@@ -8,7 +8,7 @@ OTHERS=false
|
|
8
8
|
AVERAGE=1
|
9
9
|
MASTER_AS=master
|
10
10
|
|
11
|
-
while getopts "r:k:
|
11
|
+
while getopts "r:k:om:a:" optname; do
|
12
12
|
case "$optname" in
|
13
13
|
"r")
|
14
14
|
RUBY_VERSIONS="$OPTARG"
|
@@ -18,13 +18,13 @@ while getopts "r:k:o:m:a:" optname; do
|
|
18
18
|
;;
|
19
19
|
"o")
|
20
20
|
OTHERS=true
|
21
|
-
;;
|
22
|
-
"m")
|
23
|
-
MASTER_AS="$OPTARG"
|
24
21
|
;;
|
25
|
-
|
26
|
-
|
27
|
-
|
22
|
+
"m")
|
23
|
+
MASTER_AS="$OPTARG"
|
24
|
+
;;
|
25
|
+
"a")
|
26
|
+
AVERAGE="$OPTARG"
|
27
|
+
;;
|
28
28
|
"?")
|
29
29
|
echo "Unknown option $OPTARG"
|
30
30
|
exit 1
|
@@ -50,8 +50,8 @@ git clone .git ${TMPDIR}/kramdown
|
|
50
50
|
cd ${TMPDIR}/kramdown
|
51
51
|
|
52
52
|
for RUBY_VERSION in $RUBY_VERSIONS; do
|
53
|
-
|
54
|
-
|
53
|
+
rvm use $RUBY_VERSION
|
54
|
+
echo "Creating benchmark data for $(ruby -v)"
|
55
55
|
|
56
56
|
for KD_VERSION in $KD_VERSIONS; do
|
57
57
|
echo "Using kramdown version $KD_VERSION"
|
data/doc/default.scss
CHANGED
@@ -190,3 +190,28 @@ acronym {
|
|
190
190
|
display: block;
|
191
191
|
text-align: center;
|
192
192
|
}
|
193
|
+
|
194
|
+
|
195
|
+
.patreon, .patreon:hover {
|
196
|
+
border-radius: 50px;
|
197
|
+
padding: 5px 10px;
|
198
|
+
margin: 0 5px;
|
199
|
+
display: inline-block;
|
200
|
+
text-decoration: none !important;
|
201
|
+
background-color: #e6461a !important;
|
202
|
+
box-shadow: 0px 0px 5px 5px #e6461a;
|
203
|
+
color: white !important;
|
204
|
+
font-weight: bold;
|
205
|
+
|
206
|
+
&:hover {
|
207
|
+
box-shadow: 0px 0px 0px 5px #e6461a;
|
208
|
+
}
|
209
|
+
}
|
210
|
+
|
211
|
+
#call-to-arms {
|
212
|
+
text-align: center;
|
213
|
+
margin: 40px 0 10px;
|
214
|
+
background-color: rgba(255, 255, 255, 0.18);
|
215
|
+
padding: 30px;
|
216
|
+
border-radius: 100px;
|
217
|
+
}
|
data/doc/documentation.template
CHANGED
data/doc/index.page
CHANGED
@@ -97,12 +97,16 @@ extensions that have been made popular by the [PHP Markdown Extra] package and [
|
|
97
97
|
It is probably the fastest pure-Ruby Markdown converter available (September 2014), being about 3x
|
98
98
|
faster than [Maruku] and about 4.5x faster than [BlueFeather].
|
99
99
|
|
100
|
-
Version **1.
|
101
|
-
**2017-
|
100
|
+
Version **1.14.0**{:itemprop="softwareVersion"} released on
|
101
|
+
**2017-06-26**{:itemprop="datePublished"}, [more news](news.html)
|
102
102
|
{: style="text-align: center; font-size: 80%"}
|
103
103
|
|
104
104
|
</div>
|
105
105
|
|
106
|
+
<div id="call-to-arms">
|
107
|
+
Support kramdown development and <a href="https://www.patreon.com/bePatron?u=4908963" class="patreon">become a patron</a>!
|
108
|
+
</div>
|
109
|
+
|
106
110
|
|
107
111
|
[PHP Markdown Extra]: http://michelf.com/projects/php-markdown/extra/
|
108
112
|
[Maruku]: http://maruku.rubyforge.org
|
data/doc/quickref.page
CHANGED
@@ -3,6 +3,10 @@ title: Quick Reference
|
|
3
3
|
in_menu: true
|
4
4
|
sort_info: 9
|
5
5
|
--- name:sidebar
|
6
|
+
<div style="text-align: right">
|
7
|
+
<a href="https://www.patreon.com/bePatron?u=4908963" class="patreon">Become a Patron!</a>
|
8
|
+
</div>
|
9
|
+
|
6
10
|
<h1>Contents</h1>
|
7
11
|
|
8
12
|
{menu: {options: {descendants: true, levels: [2,6]}}}
|
@@ -518,7 +522,7 @@ syntax to HTML.
|
|
518
522
|
{kdexample}
|
519
523
|
|
520
524
|
If you want to use literal backticks in your code, just use two or more backticks as delimiters. The
|
521
|
-
space right after the beginning delimiter and the one right before the closing delimiter are
|
525
|
+
space right after the beginning delimiter and the one right before the closing delimiter are ignored:
|
522
526
|
|
523
527
|
{kdexample::}
|
524
528
|
Use backticks to markup code,
|
data/doc/sidebar.template
CHANGED
@@ -1,9 +1,13 @@
|
|
1
1
|
<h2>Support kramdown</h2>
|
2
2
|
|
3
3
|
<p>If you like kramdown and would like to support it, you are welcome to make a small
|
4
|
-
donation (PayPal or Pledgie) -- it will surely be appreciated! Thanks!</p>
|
4
|
+
donation (Patreon, PayPal or Pledgie) -- it will surely be appreciated! Thanks!</p>
|
5
5
|
|
6
|
-
<
|
6
|
+
<div style="text-align: center">
|
7
|
+
|
8
|
+
<a href="https://www.patreon.com/bePatron?u=4908963" class="patreon">Become a Patron!</a>
|
9
|
+
|
10
|
+
<form style="margin-top: 15px" action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
|
7
11
|
<input type="hidden" name="cmd" value="_s-xclick">
|
8
12
|
<input type="hidden" name="hosted_button_id" value="99HUWKWPMUHWG">
|
9
13
|
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
|
@@ -12,6 +16,8 @@ donation (PayPal or Pledgie) -- it will surely be appreciated! Thanks!</p>
|
|
12
16
|
|
13
17
|
<a href='https://pledgie.com/campaigns/16657'><img alt='Click here to lend your support to: kramdown and make a donation at pledgie.com !' src='https://pledgie.com/campaigns/16657.png?skin_name=chrome' border='0' ></a>
|
14
18
|
|
19
|
+
</div>
|
20
|
+
|
15
21
|
<h2>Sponsors</h2>
|
16
22
|
|
17
23
|
<p>GROSSWEBER provides <a href="http://grossweber.com/b/kramdown" target="_blank">software
|
data/doc/syntax.page
CHANGED
@@ -3,6 +3,10 @@ title: Syntax
|
|
3
3
|
in_menu: true
|
4
4
|
sort_info: 10
|
5
5
|
--- name:sidebar
|
6
|
+
<div style="text-align: right">
|
7
|
+
<a href="https://www.patreon.com/bePatron?u=4908963" class="patreon">Become a Patron!</a>
|
8
|
+
</div>
|
9
|
+
|
6
10
|
<h1>Contents</h1>
|
7
11
|
|
8
12
|
{menu: {options: {descendants: true, levels: [2,6]}}}
|
data/lib/kramdown/converter.rb
CHANGED
@@ -27,6 +27,7 @@ module Kramdown
|
|
27
27
|
autoload :RemoveHtmlTags, 'kramdown/converter/remove_html_tags'
|
28
28
|
autoload :Pdf, 'kramdown/converter/pdf'
|
29
29
|
autoload :HashAST, 'kramdown/converter/hash_ast'
|
30
|
+
autoload :HashAst, 'kramdown/converter/hash_ast'
|
30
31
|
autoload :Man, 'kramdown/converter/man'
|
31
32
|
|
32
33
|
extend ::Kramdown::Utils::Configurable
|
@@ -67,7 +67,7 @@ module Kramdown
|
|
67
67
|
false
|
68
68
|
end
|
69
69
|
|
70
|
-
# Returns whether the template should be applied
|
70
|
+
# Returns whether the template should be applied after the conversion of the tree.
|
71
71
|
#
|
72
72
|
# Defaults to true.
|
73
73
|
def apply_template_after?
|
@@ -17,6 +17,14 @@ module Kramdown::Converter::SyntaxHighlighter
|
|
17
17
|
|
18
18
|
# Highlighting via Rouge is available if this constant is +true+.
|
19
19
|
AVAILABLE = true
|
20
|
+
|
21
|
+
begin
|
22
|
+
# Rouge::Formatters::HTMLLegacy is available on Rouge 2.0 or later
|
23
|
+
FORMATTER_CLASS = ::Rouge::Formatters::HTMLLegacy
|
24
|
+
rescue NameError
|
25
|
+
# Fallbacks to Rouge 1.x formatter if Rouge::Formatters::HTMLLegacy is not available
|
26
|
+
FORMATTER_CLASS = ::Rouge::Formatters::HTML
|
27
|
+
end
|
20
28
|
rescue LoadError, SyntaxError
|
21
29
|
AVAILABLE = false # :nodoc:
|
22
30
|
end
|
@@ -26,8 +34,8 @@ module Kramdown::Converter::SyntaxHighlighter
|
|
26
34
|
call_opts[:default_lang] = opts[:default_lang]
|
27
35
|
lexer = ::Rouge::Lexer.find_fancy(lang || opts[:default_lang], text)
|
28
36
|
return nil if opts[:disable] || !lexer
|
29
|
-
|
30
|
-
formatter = (opts.fetch(:formatter,
|
37
|
+
opts[:css_class] ||= 'highlight' # For backward compatibility when using Rouge 2.0
|
38
|
+
formatter = (opts.fetch(:formatter, FORMATTER_CLASS)).new(opts)
|
31
39
|
formatter.format(lexer.lex(text))
|
32
40
|
end
|
33
41
|
|
data/lib/kramdown/parser/gfm.rb
CHANGED
@@ -84,7 +84,13 @@ module Kramdown
|
|
84
84
|
elsif child.type == :smart_quote
|
85
85
|
raw_text << ::Kramdown::Utils::Entities.entity(child.value.to_s).char
|
86
86
|
elsif child.type == :typographic_sym
|
87
|
-
|
87
|
+
if child.value == :laquo_space
|
88
|
+
raw_text << "« "
|
89
|
+
elsif child.value == :raquo_space
|
90
|
+
raw_text << " »"
|
91
|
+
else
|
92
|
+
raw_text << ::Kramdown::Utils::Entities.entity(child.value.to_s).char
|
93
|
+
end
|
88
94
|
else
|
89
95
|
child.children.each {|c| append_text.call(c)}
|
90
96
|
end
|
data/lib/kramdown/version.rb
CHANGED
data/test/test_files.rb
CHANGED
@@ -15,8 +15,14 @@ require 'tmpdir'
|
|
15
15
|
begin
|
16
16
|
require 'kramdown/converter/syntax_highlighter/rouge'
|
17
17
|
|
18
|
+
class Kramdown::Converter::SyntaxHighlighter::Rouge::FORMATTER_CLASS
|
19
|
+
def format(tokens, &b)
|
20
|
+
super.sub(/<\/code><\/pre>\n?/, "</code></pre>\n")
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
18
24
|
# custom formatter for tests
|
19
|
-
class RougeHTMLFormatters < ::Rouge::
|
25
|
+
class RougeHTMLFormatters < Kramdown::Converter::SyntaxHighlighter::Rouge::FORMATTER_CLASS
|
20
26
|
tag 'rouge_html_formatters'
|
21
27
|
|
22
28
|
def stream(tokens, &b)
|
@@ -22,6 +22,6 @@
|
|
22
22
|
|
23
23
|
<h3 id="with-smart-quotes">With “smart” quotes</h3>
|
24
24
|
|
25
|
-
<h3 id="with--typographic--symbols">with — typographic … symbols</h3>
|
25
|
+
<h3 id="with--typographic--symbols">with — « typographic » … symbols</h3>
|
26
26
|
|
27
27
|
<h3 id="with-m5">with <script type="math/tex">m=5</script></h3>
|
@@ -22,6 +22,6 @@
|
|
22
22
|
|
23
23
|
<h3 id="with-smart-quotes">With “smart” quotes</h3>
|
24
24
|
|
25
|
-
<h3 id="with--typographic--symbols">with — typographic … symbols</h3>
|
25
|
+
<h3 id="with--typographic--symbols">with — « typographic » … symbols</h3>
|
26
26
|
|
27
27
|
<h3 id="with-m5">with <script type="math/tex">m=5</script></h3>
|
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.
|
4
|
+
version: 1.14.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: 2017-
|
11
|
+
date: 2017-06-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|