kramdown 0.13.4 → 0.13.5
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 +2 -1
- data/ChangeLog +237 -0
- data/Rakefile +5 -4
- data/VERSION +1 -1
- data/bin/kramdown +1 -1
- data/doc/bg.png +0 -0
- data/doc/default.scss.css +127 -473
- data/doc/default.template +27 -40
- data/doc/design.scss.css +441 -0
- data/doc/documentation.page +4 -1
- data/doc/index.page +4 -9
- data/doc/installation.page +3 -3
- data/doc/news.page +1 -1
- data/doc/quickref.page +1 -1
- data/doc/sidebar.template +21 -0
- data/doc/syntax.page +65 -38
- data/doc/tests.page +6 -4
- data/lib/kramdown.rb +1 -1
- data/lib/kramdown/compatibility.rb +17 -3
- data/lib/kramdown/converter.rb +1 -1
- data/lib/kramdown/converter/base.rb +1 -1
- data/lib/kramdown/converter/html.rb +3 -2
- data/lib/kramdown/converter/kramdown.rb +13 -7
- data/lib/kramdown/converter/latex.rb +1 -1
- data/lib/kramdown/converter/toc.rb +1 -1
- data/lib/kramdown/document.rb +2 -2
- data/lib/kramdown/element.rb +1 -1
- data/lib/kramdown/error.rb +1 -1
- data/lib/kramdown/options.rb +1 -1
- data/lib/kramdown/parser.rb +1 -1
- data/lib/kramdown/parser/base.rb +1 -1
- data/lib/kramdown/parser/html.rb +5 -5
- data/lib/kramdown/parser/kramdown.rb +1 -1
- data/lib/kramdown/parser/kramdown/abbreviation.rb +1 -1
- data/lib/kramdown/parser/kramdown/autolink.rb +1 -1
- data/lib/kramdown/parser/kramdown/blank_line.rb +1 -1
- data/lib/kramdown/parser/kramdown/block_boundary.rb +1 -1
- data/lib/kramdown/parser/kramdown/blockquote.rb +1 -1
- data/lib/kramdown/parser/kramdown/codeblock.rb +1 -1
- data/lib/kramdown/parser/kramdown/codespan.rb +1 -1
- data/lib/kramdown/parser/kramdown/emphasis.rb +1 -1
- data/lib/kramdown/parser/kramdown/eob.rb +1 -1
- data/lib/kramdown/parser/kramdown/escaped_chars.rb +1 -1
- data/lib/kramdown/parser/kramdown/extensions.rb +1 -1
- data/lib/kramdown/parser/kramdown/footnote.rb +1 -1
- data/lib/kramdown/parser/kramdown/header.rb +1 -1
- data/lib/kramdown/parser/kramdown/horizontal_rule.rb +1 -1
- data/lib/kramdown/parser/kramdown/html.rb +2 -2
- data/lib/kramdown/parser/kramdown/html_entity.rb +1 -1
- data/lib/kramdown/parser/kramdown/line_break.rb +1 -1
- data/lib/kramdown/parser/kramdown/link.rb +1 -1
- data/lib/kramdown/parser/kramdown/list.rb +1 -1
- data/lib/kramdown/parser/kramdown/math.rb +4 -3
- data/lib/kramdown/parser/kramdown/paragraph.rb +1 -1
- data/lib/kramdown/parser/kramdown/smart_quotes.rb +1 -1
- data/lib/kramdown/parser/kramdown/table.rb +1 -1
- data/lib/kramdown/parser/kramdown/typographic_symbol.rb +1 -1
- data/lib/kramdown/parser/markdown.rb +1 -1
- data/lib/kramdown/utils.rb +6 -1
- data/lib/kramdown/utils/entities.rb +1 -1
- data/lib/kramdown/utils/html.rb +2 -2
- data/lib/kramdown/utils/ordered_hash.rb +1 -1
- data/lib/kramdown/version.rb +2 -2
- data/man/man1/kramdown.1 +100 -100
- data/test/run_tests.rb +1 -1
- data/test/test_files.rb +1 -1
- data/test/testcases/block/04_header/with_auto_ids.html +2 -0
- data/test/testcases/block/04_header/with_auto_ids.text +3 -0
- data/test/testcases/block/09_html/html5_attributes.html +13 -0
- data/test/testcases/block/09_html/html5_attributes.text +13 -0
- data/test/testcases/block/09_html/simple.text +1 -1
- data/test/testcases/block/15_math/normal.html +2 -2
- data/test/testcases/span/05_html/normal.html +1 -1
- data/test/testcases/span/05_html/normal.text +1 -1
- data/test/testcases/span/math/normal.html +4 -0
- data/test/testcases/span/math/normal.text +5 -1
- metadata +55 -35
data/lib/kramdown/utils/html.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
#
|
3
3
|
#--
|
4
|
-
# Copyright (C) 2009-
|
4
|
+
# Copyright (C) 2009-2012 Thomas Leitner <t_leitner@gmx.at>
|
5
5
|
#
|
6
6
|
# This file is part of kramdown.
|
7
7
|
#
|
@@ -50,7 +50,7 @@ module Kramdown
|
|
50
50
|
|
51
51
|
# Return the HTML representation of the attributes +attr+.
|
52
52
|
def html_attributes(attr)
|
53
|
-
attr.map {|k,v| v.nil? ? '' : " #{k}=\"#{escape_html(v.to_s, :attribute)}\"" }.join('')
|
53
|
+
attr.map {|k,v| v.nil? || (k == 'id' && v.strip.empty?) ? '' : " #{k}=\"#{escape_html(v.to_s, :attribute)}\"" }.join('')
|
54
54
|
end
|
55
55
|
|
56
56
|
# :stopdoc:
|
data/lib/kramdown/version.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
#
|
3
3
|
#--
|
4
|
-
# Copyright (C) 2009-
|
4
|
+
# Copyright (C) 2009-2012 Thomas Leitner <t_leitner@gmx.at>
|
5
5
|
#
|
6
6
|
# This file is part of kramdown.
|
7
7
|
#
|
@@ -23,6 +23,6 @@
|
|
23
23
|
module Kramdown
|
24
24
|
|
25
25
|
# The kramdown version.
|
26
|
-
VERSION = '0.13.
|
26
|
+
VERSION = '0.13.5'
|
27
27
|
|
28
28
|
end
|
data/man/man1/kramdown.1
CHANGED
@@ -33,6 +33,29 @@ Show the help.
|
|
33
33
|
|
34
34
|
.SH KRAMDOWN OPTIONS
|
35
35
|
|
36
|
+
.TP
|
37
|
+
.B \-\-auto-id-prefix ARG
|
38
|
+
|
39
|
+
Prefix used for automatically generated heaer IDs
|
40
|
+
|
41
|
+
This option can be used to set a prefix for the automatically generated
|
42
|
+
header IDs so that there is no conflict when rendering multiple kramdown
|
43
|
+
documents into one output file separately. The prefix should only
|
44
|
+
contain characters that are valid in an ID!
|
45
|
+
|
46
|
+
Default: ''
|
47
|
+
Used by: HTML/Latex converter
|
48
|
+
|
49
|
+
|
50
|
+
.TP
|
51
|
+
.B \-\-coderay-line-number-start ARG
|
52
|
+
|
53
|
+
The start value for the line numbers
|
54
|
+
|
55
|
+
Default: 1
|
56
|
+
Used by: HTML converter
|
57
|
+
|
58
|
+
|
36
59
|
.TP
|
37
60
|
.B \-\-template ARG
|
38
61
|
|
@@ -57,29 +80,28 @@ Used by: all converters
|
|
57
80
|
|
58
81
|
|
59
82
|
.TP
|
60
|
-
.B \-\-
|
83
|
+
.B \-\-toc-levels ARG
|
61
84
|
|
62
|
-
|
85
|
+
Defines the levels that are used for the table of contents
|
63
86
|
|
64
|
-
|
65
|
-
|
87
|
+
The individual levels can be specified by separating them with commas
|
88
|
+
(e.g. 1,2,3) or by using the range syntax (e.g. 1..3). Only the
|
89
|
+
specified levels are used for the table of contents.
|
66
90
|
|
67
|
-
Default:
|
91
|
+
Default: 1..6
|
68
92
|
Used by: HTML/Latex converter
|
69
93
|
|
70
94
|
|
71
95
|
.TP
|
72
|
-
.B \-\-
|
96
|
+
.B \-\-coderay-line-numbers ARG
|
73
97
|
|
74
|
-
|
98
|
+
Defines how and if line numbers should be shown
|
75
99
|
|
76
|
-
|
77
|
-
|
78
|
-
documents into one output file separately. The prefix should only
|
79
|
-
contain characters that are valid in an ID!
|
100
|
+
The possible values are :table, :inline, :list or nil. If this option is
|
101
|
+
nil, no line numbers are shown.
|
80
102
|
|
81
|
-
Default:
|
82
|
-
Used by: HTML
|
103
|
+
Default: :inline
|
104
|
+
Used by: HTML converter
|
83
105
|
|
84
106
|
|
85
107
|
.TP
|
@@ -97,105 +119,108 @@ Used by: kramdown parser
|
|
97
119
|
|
98
120
|
|
99
121
|
.TP
|
100
|
-
.B \-\-
|
101
|
-
|
102
|
-
Process kramdown syntax in span HTML tags
|
122
|
+
.B \-\-coderay-tab-width ARG
|
103
123
|
|
104
|
-
|
105
|
-
span HTML tags as text containing span-level elements.
|
124
|
+
The tab width used in highlighted code
|
106
125
|
|
107
|
-
|
108
|
-
Used by: kramdown parser
|
126
|
+
Used by: HTML converter
|
109
127
|
|
110
128
|
|
111
129
|
.TP
|
112
|
-
.B \-\-
|
113
|
-
|
114
|
-
Convert HTML elements to native elements
|
115
|
-
|
116
|
-
If this option is `true`, the parser converts HTML elements to native
|
117
|
-
elements. For example, when parsing `<em>hallo</em>` the emphasis tag
|
118
|
-
would normally be converted to an `:html` element with tag type `:em`.
|
119
|
-
If `html_to_native` is `true`, then the emphasis would be converted to a
|
120
|
-
native `:em` element.
|
130
|
+
.B \-\-line-width ARG
|
121
131
|
|
122
|
-
|
132
|
+
Defines the line width to be used when outputting a document
|
123
133
|
|
124
|
-
Default:
|
125
|
-
Used by: kramdown
|
134
|
+
Default: 72
|
135
|
+
Used by: kramdown converter
|
126
136
|
|
127
137
|
|
128
138
|
.TP
|
129
|
-
.B \-\-
|
139
|
+
.B \-\-[no\-]parse-span-html
|
130
140
|
|
131
|
-
|
141
|
+
Process kramdown syntax in span HTML tags
|
132
142
|
|
133
|
-
|
134
|
-
|
143
|
+
If this option is `true`, the kramdown parser processes the content of
|
144
|
+
span HTML tags as text containing span-level elements.
|
135
145
|
|
136
|
-
Default:
|
137
|
-
Used by:
|
146
|
+
Default: true
|
147
|
+
Used by: kramdown parser
|
138
148
|
|
139
149
|
|
140
150
|
.TP
|
141
|
-
.B \-\-coderay-
|
142
|
-
|
143
|
-
Defines how the highlighted code should be wrapped
|
151
|
+
.B \-\-coderay-bold-every ARG
|
144
152
|
|
145
|
-
|
153
|
+
Defines how often a line number should be made bold
|
146
154
|
|
147
|
-
Default:
|
155
|
+
Default: 10
|
148
156
|
Used by: HTML converter
|
149
157
|
|
150
158
|
|
151
159
|
.TP
|
152
|
-
.B \-\-
|
160
|
+
.B \-\-latex-headers ARG
|
153
161
|
|
154
|
-
Defines
|
162
|
+
Defines the LaTeX commands for different header levels
|
155
163
|
|
156
|
-
The
|
157
|
-
|
164
|
+
The commands for the header levels one to six can be specified by
|
165
|
+
separating them with commas.
|
158
166
|
|
159
|
-
Default:
|
160
|
-
Used by:
|
167
|
+
Default: section,subsection,subsubsection,paragraph,subparagraph,subsubparagraph
|
168
|
+
Used by: Latex converter
|
161
169
|
|
162
170
|
|
163
171
|
.TP
|
164
|
-
.B \-\-
|
172
|
+
.B \-\-[no\-]html-to-native
|
165
173
|
|
166
|
-
|
174
|
+
Convert HTML elements to native elements
|
167
175
|
|
168
|
-
|
169
|
-
|
176
|
+
If this option is `true`, the parser converts HTML elements to native
|
177
|
+
elements. For example, when parsing `<em>hallo</em>` the emphasis tag
|
178
|
+
would normally be converted to an `:html` element with tag type `:em`.
|
179
|
+
If `html_to_native` is `true`, then the emphasis would be converted to a
|
180
|
+
native `:em` element.
|
181
|
+
|
182
|
+
This is useful for converters that cannot deal with HTML elements.
|
183
|
+
|
184
|
+
Default: false
|
185
|
+
Used by: kramdown parser
|
170
186
|
|
171
187
|
|
172
188
|
.TP
|
173
|
-
.B \-\-coderay-
|
189
|
+
.B \-\-coderay-css ARG
|
174
190
|
|
175
|
-
|
191
|
+
Defines how the highlighted code gets styled
|
176
192
|
|
193
|
+
Possible values are :class (CSS classes are applied to the code
|
194
|
+
elements, one must supply the needed CSS file) or :style (default CSS
|
195
|
+
styles are directly applied to the code elements).
|
196
|
+
|
197
|
+
Default: style
|
177
198
|
Used by: HTML converter
|
178
199
|
|
179
200
|
|
180
201
|
.TP
|
181
|
-
.B \-\-
|
202
|
+
.B \-\-smart-quotes ARG
|
182
203
|
|
183
|
-
Defines
|
204
|
+
Defines the HTML entity names or code points for smart quote output
|
184
205
|
|
185
|
-
|
186
|
-
|
206
|
+
The entities identified by entity name or code point that should be
|
207
|
+
used for, in order, a left single quote, a right single quote, a left
|
208
|
+
double and a right double quote are specified by separating them with
|
209
|
+
commas.
|
210
|
+
|
211
|
+
Default: lsquo,rsquo,ldquo,rdquo
|
212
|
+
Used by: HTML/Latex converter
|
187
213
|
|
188
214
|
|
189
215
|
.TP
|
190
|
-
.B \-\-
|
216
|
+
.B \-\-footnote-nr ARG
|
191
217
|
|
192
|
-
|
218
|
+
The number of the first footnote
|
193
219
|
|
194
|
-
|
195
|
-
|
196
|
-
styles are directly applied to the code elements).
|
220
|
+
This option can be used to specify the number that is used for the first
|
221
|
+
footnote.
|
197
222
|
|
198
|
-
Default:
|
223
|
+
Default: 1
|
199
224
|
Used by: HTML converter
|
200
225
|
|
201
226
|
|
@@ -215,50 +240,25 @@ Used by: HTML converter, kramdown converter
|
|
215
240
|
|
216
241
|
|
217
242
|
.TP
|
218
|
-
.B \-\-
|
219
|
-
|
220
|
-
Defines the levels that are used for the table of contents
|
221
|
-
|
222
|
-
The individual levels can be specified by separating them with commas
|
223
|
-
(e.g. 1,2,3) or by using the range syntax (e.g. 1..3). Only the
|
224
|
-
specified levels are used for the table of contents.
|
225
|
-
|
226
|
-
Default: 1..6
|
227
|
-
Used by: HTML/Latex converter
|
228
|
-
|
229
|
-
|
230
|
-
.TP
|
231
|
-
.B \-\-line-width ARG
|
232
|
-
|
233
|
-
Defines the line width to be used when outputting a document
|
234
|
-
|
235
|
-
Default: 72
|
236
|
-
Used by: kramdown converter
|
237
|
-
|
238
|
-
|
239
|
-
.TP
|
240
|
-
.B \-\-latex-headers ARG
|
243
|
+
.B \-\-coderay-wrap ARG
|
241
244
|
|
242
|
-
Defines the
|
245
|
+
Defines how the highlighted code should be wrapped
|
243
246
|
|
244
|
-
The
|
245
|
-
separating them with commas.
|
247
|
+
The possible values are :span, :div or nil.
|
246
248
|
|
247
|
-
Default:
|
248
|
-
Used by:
|
249
|
+
Default: :div
|
250
|
+
Used by: HTML converter
|
249
251
|
|
250
252
|
|
251
253
|
.TP
|
252
|
-
.B \-\-
|
254
|
+
.B \-\-[no\-]auto-ids
|
253
255
|
|
254
|
-
|
256
|
+
Use automatic header ID generation
|
255
257
|
|
256
|
-
|
257
|
-
|
258
|
-
double and a right double quote are specified by separating them with
|
259
|
-
commas.
|
258
|
+
If this option is `true`, ID values for all headers are automatically
|
259
|
+
generated if no ID is explicitly specified.
|
260
260
|
|
261
|
-
Default:
|
261
|
+
Default: true
|
262
262
|
Used by: HTML/Latex converter
|
263
263
|
|
264
264
|
|
data/test/run_tests.rb
CHANGED
data/test/test_files.rb
CHANGED
@@ -0,0 +1,13 @@
|
|
1
|
+
<p lang="en" style="nothing" class="">paragraph</p>
|
2
|
+
|
3
|
+
<p lang="en" style="nothing" class="">paragraph</p>
|
4
|
+
|
5
|
+
<p lang="en" style="nothing" class="">paragraph</p>
|
6
|
+
|
7
|
+
<p lang="en" class="" style="nothing">paragraph</p>
|
8
|
+
|
9
|
+
<p class="" lang="en" style="nothing">paragraph</p>
|
10
|
+
|
11
|
+
<p class="">paragraph</p>
|
12
|
+
|
13
|
+
<p class="">paragraph</p>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<p lang="en" style='nothing' class>paragraph</p>
|
2
|
+
|
3
|
+
<p lang='en' style="nothing" class>paragraph</p>
|
4
|
+
|
5
|
+
<p lang='en' style="nothing" class >paragraph</p>
|
6
|
+
|
7
|
+
<p lang='en' class style="nothing">paragraph</p>
|
8
|
+
|
9
|
+
<p class lang='en' style="nothing">paragraph</p>
|
10
|
+
|
11
|
+
<p cLaSs>paragraph</p>
|
12
|
+
|
13
|
+
<p class >paragraph</p>
|
@@ -6,10 +6,10 @@
|
|
6
6
|
<p><script type="math/tex">\lambda_\alpha > 5</script>
|
7
7
|
This is a para.</p>
|
8
8
|
|
9
|
-
<script type="math/tex; mode=display"
|
9
|
+
<script type="math/tex; mode=display"><![CDATA[\begin{align*}
|
10
10
|
&=5 \\
|
11
11
|
&=6 \\
|
12
|
-
\end{align*}
|
12
|
+
\end{align*}]]></script>
|
13
13
|
|
14
14
|
<script type="math/tex; mode=display">5+5</script>
|
15
15
|
|