kramdown 0.13.5 → 0.13.6

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  Count Name
2
2
  ======= ====
3
- 498 Thomas Leitner <t_leitner@gmx.at>
3
+ 501 Thomas Leitner <t_leitner@gmx.at>
4
4
  3 gettalong <t_leitner@gmx.at>
5
5
  3 Ben Armston <ben.armston@googlemail.com>
6
6
  3 Alex Marandon <contact@alexmarandon.com>
data/ChangeLog CHANGED
@@ -1,3 +1,43 @@
1
+ commit 40e6cde2d3e1a4f9f6bc14a243b22b4ae3311ca2
2
+ Author: Thomas Leitner <t_leitner@gmx.at>
3
+ Date: Wed May 9 19:53:47 2012 +0200
4
+
5
+ Updated release notes and version number
6
+
7
+ doc/news/release_0_13_6.page
8
+ doc/sidebar.template
9
+ lib/kramdown/version.rb
10
+ man/man1/kramdown.1.erb
11
+
12
+ commit 7f66dca331f78d84ef22c489c755360b304cb41f
13
+ Author: Thomas Leitner <t_leitner@gmx.at>
14
+ Date: Tue May 8 21:20:46 2012 +0200
15
+
16
+ Fixed bug RF#29557: Parsing fails with lists with empty list item
17
+
18
+ If a list item is completely empty, it needs to be handled specially,
19
+ which is done now.
20
+
21
+ lib/kramdown/converter/kramdown.rb
22
+ lib/kramdown/parser/kramdown/list.rb
23
+ test/testcases/block/08_list/special_cases.html
24
+ test/testcases/block/08_list/special_cases.text
25
+
26
+ commit ac00ea8ea590ece6c7a6c53b30920114f349b79b
27
+ Author: Thomas Leitner <t_leitner@gmx.at>
28
+ Date: Tue May 8 20:02:43 2012 +0200
29
+
30
+ Fixed problem with CDATA section in non-XHTML pages
31
+
32
+ The HTML parser does not parse CDATA in script tags and
33
+ therefore the CDATA tags were displayed in MathJax output.
34
+ By commenting out the CDATA tags (with LaTeX comment syntax)
35
+ we avoid this problem.
36
+
37
+ lib/kramdown/converter/html.rb
38
+ lib/kramdown/parser/html.rb
39
+ test/testcases/block/15_math/normal.html
40
+
1
41
  commit ce785c7cc29372cb7c5c47647535b1943348aff6
2
42
  Author: Thomas Leitner <t_leitner@gmx.at>
3
43
  Date: Sun Feb 19 15:34:37 2012 +0100
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.13.5
1
+ 0.13.6
data/doc/sidebar.template CHANGED
@@ -1,7 +1,7 @@
1
1
  <h2>News</h2>
2
2
 
3
- <p>The latest version of kramdown is <b>0.13.5</b> and it was released
4
- on <b>2012-02-19</b>.</p>
3
+ <p>The latest version of kramdown is <b>0.13.6</b> and it was released
4
+ on <b>2012-05-09</b>.</p>
5
5
 
6
6
  <p>More <a href="news.html">news</a>…</p>
7
7
 
@@ -315,7 +315,7 @@ module Kramdown
315
315
 
316
316
  def convert_math(el, indent)
317
317
  block = (el.options[:category] == :block)
318
- value = (el.value =~ /<|&/ ? "<![CDATA[#{el.value}]]>" : el.value)
318
+ value = (el.value =~ /<|&/ ? "% <![CDATA[\n#{el.value} %]]>" : el.value)
319
319
  "<script type=\"math/tex#{block ? '; mode=display' : ''}\">#{value}</script>#{block ? "\n" : ''}"
320
320
  end
321
321
 
@@ -134,7 +134,7 @@ module Kramdown
134
134
 
135
135
  def convert_li(el, opts)
136
136
  sym, width = if @stack.last.type == :ul
137
- ['* ', el.children.first.type == :codeblock ? 4 : 2]
137
+ ['* ', el.children.first && el.children.first.type == :codeblock ? 4 : 2]
138
138
  else
139
139
  ["#{opts[:index] + 1}.".ljust(4), 4]
140
140
  end
@@ -147,13 +147,13 @@ module Kramdown
147
147
  newlines = text.scan(/\n*\Z/).first
148
148
  first, *last = text.split(/\n/)
149
149
  last = last.map {|l| " "*width + l}.join("\n")
150
- text = first + (last.empty? ? "" : "\n") + last + newlines
151
- if el.children.first.type == :p && !el.children.first.options[:transparent]
150
+ text = (first.nil? ? "\n" : first + (last.empty? ? "" : "\n") + last + newlines)
151
+ if el.children.first && el.children.first.type == :p && !el.children.first.options[:transparent]
152
152
  res = "#{sym}#{text}"
153
153
  res << "^\n" if el.children.size == 1 && @stack.last.children.last == el &&
154
154
  (@stack.last.children.any? {|c| c.children.first.type != :p} || @stack.last.children.size == 1)
155
155
  res
156
- elsif el.children.first.type == :codeblock
156
+ elsif el.children.first && el.children.first.type == :codeblock
157
157
  "#{sym}\n #{text}"
158
158
  else
159
159
  "#{sym}#{text}"
@@ -529,7 +529,7 @@ module Kramdown
529
529
 
530
530
  def handle_math_tag(el)
531
531
  set_basics(el, :math, :category => (el.attr['type'] =~ /mode=display/ ? :block : :span))
532
- el.value = el.children.shift.value.sub(/\A<!\[CDATA\[(.*)\]\]>\z/m, '\1')
532
+ el.value = el.children.shift.value.sub(/\A(?:%\s*)?<!\[CDATA\[\n?(.*?)(?:\s%)?\]\]>\z/m, '\1')
533
533
  el.attr.delete('type')
534
534
  end
535
535
 
@@ -123,7 +123,7 @@ module Kramdown
123
123
  (it.children.length < 2 || it.children[1].type != :blank ||
124
124
  (it == list.children.last && it.children.length == 2 && !eob_found)) &&
125
125
  (list.children.last != it || list.children.size == 1 ||
126
- list.children[0..-2].any? {|cit| cit.children.first.type != :p || cit.children.first.options[:transparent]})
126
+ list.children[0..-2].any? {|cit| !cit.children.first || cit.children.first.type != :p || cit.children.first.options[:transparent]})
127
127
  it.children.first.children.first.value << "\n" if it.children.size > 1 && it.children[1].type != :blank
128
128
  it.children.first.options[:transparent] = true
129
129
  end
@@ -23,6 +23,6 @@
23
23
  module Kramdown
24
24
 
25
25
  # The kramdown version.
26
- VERSION = '0.13.5'
26
+ VERSION = '0.13.6'
27
27
 
28
28
  end
data/man/man1/kramdown.1 CHANGED
@@ -1,4 +1,4 @@
1
- .TH "KRAMDOWN" 1 "July 2010"
1
+ .TH "KRAMDOWN" 1 "May 2012"
2
2
  .SH NAME
3
3
  kramdown \- a fast, pure-Ruby Markdown-superset converter
4
4
  .SH SYNOPSIS
@@ -33,29 +33,6 @@ 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
-
59
36
  .TP
60
37
  .B \-\-template ARG
61
38
 
@@ -80,28 +57,29 @@ Used by: all converters
80
57
 
81
58
 
82
59
  .TP
83
- .B \-\-toc-levels ARG
60
+ .B \-\-[no\-]auto-ids
84
61
 
85
- Defines the levels that are used for the table of contents
62
+ Use automatic header ID generation
86
63
 
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.
64
+ If this option is `true`, ID values for all headers are automatically
65
+ generated if no ID is explicitly specified.
90
66
 
91
- Default: 1..6
67
+ Default: true
92
68
  Used by: HTML/Latex converter
93
69
 
94
70
 
95
71
  .TP
96
- .B \-\-coderay-line-numbers ARG
72
+ .B \-\-auto-id-prefix ARG
97
73
 
98
- Defines how and if line numbers should be shown
74
+ Prefix used for automatically generated heaer IDs
99
75
 
100
- The possible values are :table, :inline, :list or nil. If this option is
101
- nil, no line numbers are shown.
76
+ This option can be used to set a prefix for the automatically generated
77
+ header IDs so that there is no conflict when rendering multiple kramdown
78
+ documents into one output file separately. The prefix should only
79
+ contain characters that are valid in an ID!
102
80
 
103
- Default: :inline
104
- Used by: HTML converter
81
+ Default: ''
82
+ Used by: HTML/Latex converter
105
83
 
106
84
 
107
85
  .TP
@@ -119,108 +97,105 @@ Used by: kramdown parser
119
97
 
120
98
 
121
99
  .TP
122
- .B \-\-coderay-tab-width ARG
100
+ .B \-\-[no\-]parse-span-html
123
101
 
124
- The tab width used in highlighted code
102
+ Process kramdown syntax in span HTML tags
125
103
 
126
- Used by: HTML converter
104
+ If this option is `true`, the kramdown parser processes the content of
105
+ span HTML tags as text containing span-level elements.
106
+
107
+ Default: true
108
+ Used by: kramdown parser
127
109
 
128
110
 
129
111
  .TP
130
- .B \-\-line-width ARG
112
+ .B \-\-[no\-]html-to-native
131
113
 
132
- Defines the line width to be used when outputting a document
114
+ Convert HTML elements to native elements
133
115
 
134
- Default: 72
135
- Used by: kramdown converter
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.
121
+
122
+ This is useful for converters that cannot deal with HTML elements.
123
+
124
+ Default: false
125
+ Used by: kramdown parser
136
126
 
137
127
 
138
128
  .TP
139
- .B \-\-[no\-]parse-span-html
129
+ .B \-\-footnote-nr ARG
140
130
 
141
- Process kramdown syntax in span HTML tags
131
+ The number of the first footnote
142
132
 
143
- If this option is `true`, the kramdown parser processes the content of
144
- span HTML tags as text containing span-level elements.
133
+ This option can be used to specify the number that is used for the first
134
+ footnote.
145
135
 
146
- Default: true
147
- Used by: kramdown parser
136
+ Default: 1
137
+ Used by: HTML converter
148
138
 
149
139
 
150
140
  .TP
151
- .B \-\-coderay-bold-every ARG
141
+ .B \-\-coderay-wrap ARG
152
142
 
153
- Defines how often a line number should be made bold
143
+ Defines how the highlighted code should be wrapped
154
144
 
155
- Default: 10
145
+ The possible values are :span, :div or nil.
146
+
147
+ Default: :div
156
148
  Used by: HTML converter
157
149
 
158
150
 
159
151
  .TP
160
- .B \-\-latex-headers ARG
152
+ .B \-\-coderay-line-numbers ARG
161
153
 
162
- Defines the LaTeX commands for different header levels
154
+ Defines how and if line numbers should be shown
163
155
 
164
- The commands for the header levels one to six can be specified by
165
- separating them with commas.
156
+ The possible values are :table, :inline, :list or nil. If this option is
157
+ nil, no line numbers are shown.
166
158
 
167
- Default: section,subsection,subsubsection,paragraph,subparagraph,subsubparagraph
168
- Used by: Latex converter
159
+ Default: :inline
160
+ Used by: HTML converter
169
161
 
170
162
 
171
163
  .TP
172
- .B \-\-[no\-]html-to-native
173
-
174
- Convert HTML elements to native elements
175
-
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.
164
+ .B \-\-coderay-line-number-start ARG
181
165
 
182
- This is useful for converters that cannot deal with HTML elements.
166
+ The start value for the line numbers
183
167
 
184
- Default: false
185
- Used by: kramdown parser
168
+ Default: 1
169
+ Used by: HTML converter
186
170
 
187
171
 
188
172
  .TP
189
- .B \-\-coderay-css ARG
190
-
191
- Defines how the highlighted code gets styled
173
+ .B \-\-coderay-tab-width ARG
192
174
 
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).
175
+ The tab width used in highlighted code
196
176
 
197
- Default: style
198
177
  Used by: HTML converter
199
178
 
200
179
 
201
180
  .TP
202
- .B \-\-smart-quotes ARG
203
-
204
- Defines the HTML entity names or code points for smart quote output
181
+ .B \-\-coderay-bold-every ARG
205
182
 
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.
183
+ Defines how often a line number should be made bold
210
184
 
211
- Default: lsquo,rsquo,ldquo,rdquo
212
- Used by: HTML/Latex converter
185
+ Default: 10
186
+ Used by: HTML converter
213
187
 
214
188
 
215
189
  .TP
216
- .B \-\-footnote-nr ARG
190
+ .B \-\-coderay-css ARG
217
191
 
218
- The number of the first footnote
192
+ Defines how the highlighted code gets styled
219
193
 
220
- This option can be used to specify the number that is used for the first
221
- footnote.
194
+ Possible values are :class (CSS classes are applied to the code
195
+ elements, one must supply the needed CSS file) or :style (default CSS
196
+ styles are directly applied to the code elements).
222
197
 
223
- Default: 1
198
+ Default: style
224
199
  Used by: HTML converter
225
200
 
226
201
 
@@ -240,25 +215,50 @@ Used by: HTML converter, kramdown converter
240
215
 
241
216
 
242
217
  .TP
243
- .B \-\-coderay-wrap ARG
218
+ .B \-\-toc-levels ARG
244
219
 
245
- Defines how the highlighted code should be wrapped
220
+ Defines the levels that are used for the table of contents
246
221
 
247
- The possible values are :span, :div or nil.
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.
248
225
 
249
- Default: :div
250
- Used by: HTML converter
226
+ Default: 1..6
227
+ Used by: HTML/Latex converter
251
228
 
252
229
 
253
230
  .TP
254
- .B \-\-[no\-]auto-ids
231
+ .B \-\-line-width ARG
255
232
 
256
- Use automatic header ID generation
233
+ Defines the line width to be used when outputting a document
257
234
 
258
- If this option is `true`, ID values for all headers are automatically
259
- generated if no ID is explicitly specified.
235
+ Default: 72
236
+ Used by: kramdown converter
260
237
 
261
- Default: true
238
+
239
+ .TP
240
+ .B \-\-latex-headers ARG
241
+
242
+ Defines the LaTeX commands for different header levels
243
+
244
+ The commands for the header levels one to six can be specified by
245
+ separating them with commas.
246
+
247
+ Default: section,subsection,subsubsection,paragraph,subparagraph,subsubparagraph
248
+ Used by: Latex converter
249
+
250
+
251
+ .TP
252
+ .B \-\-smart-quotes ARG
253
+
254
+ Defines the HTML entity names or code points for smart quote output
255
+
256
+ The entities identified by entity name or code point that should be
257
+ used for, in order, a left single quote, a right single quote, a left
258
+ double and a right double quote are specified by separating them with
259
+ commas.
260
+
261
+ Default: lsquo,rsquo,ldquo,rdquo
262
262
  Used by: HTML/Latex converter
263
263
 
264
264
 
@@ -53,3 +53,10 @@ here</p>
53
53
  <p>but here</p>
54
54
  </li>
55
55
  </ul>
56
+
57
+ <p>List item without content:</p>
58
+
59
+ <ul>
60
+ <li></li>
61
+ <li>a</li>
62
+ </ul>
@@ -33,3 +33,8 @@ A normal list:
33
33
  * compact
34
34
 
35
35
  * but here
36
+
37
+ List item without content:
38
+
39
+ *
40
+ * a
@@ -6,10 +6,11 @@
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"><![CDATA[\begin{align*}
9
+ <script type="math/tex; mode=display">% <![CDATA[
10
+ \begin{align*}
10
11
  &=5 \\
11
12
  &=6 \\
12
- \end{align*}]]></script>
13
+ \end{align*} %]]></script>
13
14
 
14
15
  <script type="math/tex; mode=display">5+5</script>
15
16
 
metadata CHANGED
@@ -1,48 +1,39 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: kramdown
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 13
8
- - 5
9
- version: 0.13.5
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.13.6
5
+ prerelease:
10
6
  platform: ruby
11
- authors:
7
+ authors:
12
8
  - Thomas Leitner
13
9
  autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
-
17
- date: 2012-02-19 00:00:00 +01:00
18
- default_executable: kramdown
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
12
+ date: 2012-05-09 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
21
15
  name: coderay
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- requirements:
16
+ requirement: &20421140 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
25
19
  - - ~>
26
- - !ruby/object:Gem::Version
27
- segments:
28
- - 1
29
- - 0
30
- - 0
20
+ - !ruby/object:Gem::Version
31
21
  version: 1.0.0
32
22
  type: :development
33
- version_requirements: *id001
34
- description: |
35
- kramdown is yet-another-markdown-parser but fast, pure Ruby,
23
+ prerelease: false
24
+ version_requirements: *20421140
25
+ description: ! 'kramdown is yet-another-markdown-parser but fast, pure Ruby,
26
+
36
27
  using a strict syntax definition and supporting several common extensions.
37
28
 
29
+ '
38
30
  email: t_leitner@gmx.at
39
- executables:
31
+ executables:
40
32
  - kramdown
41
33
  extensions: []
42
-
43
- extra_rdoc_files:
34
+ extra_rdoc_files:
44
35
  - README
45
- files:
36
+ files:
46
37
  - Rakefile
47
38
  - setup.rb
48
39
  - COPYING
@@ -458,36 +449,30 @@ files:
458
449
  - test/testcases/block/06_codeblock/normal.text
459
450
  - test/testcases/encoding.html
460
451
  - test/test_files.rb
461
- has_rdoc: true
462
452
  homepage: http://kramdown.rubyforge.org
463
453
  licenses: []
464
-
465
454
  post_install_message:
466
- rdoc_options:
455
+ rdoc_options:
467
456
  - --main
468
457
  - README
469
- require_paths:
458
+ require_paths:
470
459
  - lib
471
- required_ruby_version: !ruby/object:Gem::Requirement
472
- requirements:
473
- - - ">="
474
- - !ruby/object:Gem::Version
475
- segments:
476
- - 0
477
- version: "0"
478
- required_rubygems_version: !ruby/object:Gem::Requirement
479
- requirements:
480
- - - ">="
481
- - !ruby/object:Gem::Version
482
- segments:
483
- - 0
484
- version: "0"
460
+ required_ruby_version: !ruby/object:Gem::Requirement
461
+ none: false
462
+ requirements:
463
+ - - ! '>='
464
+ - !ruby/object:Gem::Version
465
+ version: '0'
466
+ required_rubygems_version: !ruby/object:Gem::Requirement
467
+ none: false
468
+ requirements:
469
+ - - ! '>='
470
+ - !ruby/object:Gem::Version
471
+ version: '0'
485
472
  requirements: []
486
-
487
473
  rubyforge_project: kramdown
488
- rubygems_version: 1.3.6
474
+ rubygems_version: 1.8.10
489
475
  signing_key:
490
476
  specification_version: 3
491
477
  summary: kramdown is a fast, pure-Ruby Markdown-superset converter.
492
478
  test_files: []
493
-