kramdown 0.11.0 → 0.12.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.

Files changed (94) hide show
  1. data/CONTRIBUTERS +1 -1
  2. data/ChangeLog +532 -0
  3. data/README +22 -12
  4. data/Rakefile +9 -8
  5. data/VERSION +1 -1
  6. data/benchmark/benchmark.sh +61 -0
  7. data/benchmark/generate_data.rb +57 -55
  8. data/benchmark/testing.sh +1 -1
  9. data/benchmark/timing.sh +3 -3
  10. data/bin/kramdown +1 -2
  11. data/data/kramdown/document.html +2 -2
  12. data/data/kramdown/document.latex +2 -2
  13. data/doc/default.scss.css +6 -1
  14. data/doc/default.template +1 -1
  15. data/doc/documentation.page +1 -1
  16. data/doc/index.page +9 -7
  17. data/doc/installation.page +2 -3
  18. data/doc/links.markdown +1 -1
  19. data/doc/quickref.page +19 -19
  20. data/doc/syntax.page +117 -98
  21. data/doc/tests.page +8 -7
  22. data/lib/kramdown/compatibility.rb +2 -1
  23. data/lib/kramdown/converter.rb +5 -7
  24. data/lib/kramdown/converter/base.rb +87 -32
  25. data/lib/kramdown/converter/html.rb +134 -122
  26. data/lib/kramdown/converter/kramdown.rb +24 -25
  27. data/lib/kramdown/converter/latex.rb +65 -55
  28. data/lib/kramdown/document.rb +487 -42
  29. data/lib/kramdown/error.rb +3 -0
  30. data/lib/kramdown/options.rb +83 -28
  31. data/lib/kramdown/parser.rb +5 -5
  32. data/lib/kramdown/parser/base.rb +55 -13
  33. data/lib/kramdown/parser/html.rb +83 -71
  34. data/lib/kramdown/parser/kramdown.rb +73 -54
  35. data/lib/kramdown/parser/kramdown/abbreviation.rb +17 -12
  36. data/lib/kramdown/parser/kramdown/autolink.rb +2 -3
  37. data/lib/kramdown/parser/kramdown/blank_line.rb +1 -1
  38. data/lib/kramdown/parser/kramdown/block_boundary.rb +2 -2
  39. data/lib/kramdown/parser/kramdown/blockquote.rb +2 -2
  40. data/lib/kramdown/parser/kramdown/codeblock.rb +5 -2
  41. data/lib/kramdown/parser/kramdown/codespan.rb +1 -2
  42. data/lib/kramdown/parser/kramdown/emphasis.rb +1 -1
  43. data/lib/kramdown/parser/kramdown/escaped_chars.rb +1 -1
  44. data/lib/kramdown/parser/kramdown/extensions.rb +204 -0
  45. data/lib/kramdown/parser/kramdown/footnote.rb +7 -7
  46. data/lib/kramdown/parser/kramdown/header.rb +4 -2
  47. data/lib/kramdown/parser/kramdown/horizontal_rule.rb +1 -1
  48. data/lib/kramdown/parser/kramdown/html.rb +39 -45
  49. data/lib/kramdown/parser/kramdown/link.rb +19 -29
  50. data/lib/kramdown/parser/kramdown/list.rb +13 -13
  51. data/lib/kramdown/parser/kramdown/math.rb +1 -1
  52. data/lib/kramdown/parser/kramdown/paragraph.rb +5 -4
  53. data/lib/kramdown/parser/kramdown/smart_quotes.rb +1 -1
  54. data/lib/kramdown/parser/kramdown/table.rb +51 -12
  55. data/lib/kramdown/parser/markdown.rb +69 -0
  56. data/lib/kramdown/utils.rb +2 -2
  57. data/lib/kramdown/utils/entities.rb +10 -1
  58. data/lib/kramdown/utils/html.rb +22 -11
  59. data/lib/kramdown/utils/ordered_hash.rb +44 -40
  60. data/lib/kramdown/version.rb +1 -1
  61. data/man/man1/kramdown.1 +31 -4
  62. data/test/testcases/block/08_list/item_ial.html +1 -1
  63. data/test/testcases/block/11_ial/nested.html +11 -0
  64. data/test/testcases/block/11_ial/nested.text +15 -0
  65. data/test/testcases/block/13_definition_list/item_ial.html +1 -1
  66. data/test/testcases/block/14_table/escaping.html +52 -0
  67. data/test/testcases/block/14_table/escaping.text +19 -0
  68. data/test/testcases/block/14_table/simple.html.19 +139 -0
  69. data/test/testcases/block/14_table/simple.text +1 -1
  70. data/test/testcases/block/15_math/normal.html +13 -13
  71. data/test/testcases/block/16_toc/{no_toc_depth.html → no_toc.html} +0 -0
  72. data/test/testcases/block/16_toc/{no_toc_depth.options → no_toc.options} +0 -0
  73. data/test/testcases/block/16_toc/{no_toc_depth.text → no_toc.text} +0 -0
  74. data/test/testcases/block/16_toc/{toc_depth_2.html → toc_levels.html} +4 -4
  75. data/test/testcases/block/16_toc/toc_levels.options +1 -0
  76. data/test/testcases/block/16_toc/{toc_depth_2.text → toc_levels.text} +0 -0
  77. data/test/testcases/span/escaped_chars/normal.html +4 -0
  78. data/test/testcases/span/escaped_chars/normal.text +4 -0
  79. data/test/testcases/span/ial/simple.html +1 -1
  80. data/test/testcases/span/math/normal.html +2 -2
  81. metadata +20 -25
  82. data/benchmark/historic-jruby-1.4.0.dat +0 -7
  83. data/benchmark/historic-ruby-1.8.6.dat +0 -7
  84. data/benchmark/historic-ruby-1.8.7.dat +0 -7
  85. data/benchmark/historic-ruby-1.9.1p243.dat +0 -7
  86. data/benchmark/historic-ruby-1.9.2dev.dat +0 -7
  87. data/benchmark/static-jruby-1.4.0.dat +0 -7
  88. data/benchmark/static-ruby-1.8.6.dat +0 -7
  89. data/benchmark/static-ruby-1.8.7.dat +0 -7
  90. data/benchmark/static-ruby-1.9.1p243.dat +0 -7
  91. data/benchmark/static-ruby-1.9.2dev.dat +0 -7
  92. data/lib/kramdown/parser/kramdown/attribute_list.rb +0 -111
  93. data/lib/kramdown/parser/kramdown/extension.rb +0 -116
  94. data/test/testcases/block/16_toc/toc_depth_2.options +0 -1
@@ -10,8 +10,7 @@ sort_info: 5
10
10
  kramdown should work on any platform which supports Ruby. It has been successfully tested on the
11
11
  following platforms:
12
12
 
13
- * Linux with Ruby 1.8.5, 1.8.6, 1.8.7, 1.9.1, 1.9.2-preview1 and jruby 1.5.0.
14
- * Mac OSX with Ruby 1.8.5, 1.8.6, 1.8.7, 1.9.1, 1.9.2-preview1 and jruby 1.5.0.
13
+ * Linux with Ruby 1.8.5, 1.8.6, 1.8.7, 1.9.2 and jruby 1.5.0.
15
14
 
16
15
  See the platform specific installation notes for more information!
17
16
 
@@ -87,4 +86,4 @@ out kramdown use the following command:
87
86
  ## Dependencies
88
87
 
89
88
  Since kramdown is written in Ruby, you just need the [Ruby interpreter](http://www.ruby-lang.org)
90
- versions 1.8.5, 1.8.6, 1.8.7 or 1.9.1. There are no other dependencies.
89
+ versions 1.8.5, 1.8.6, 1.8.7 or 1.9.2. There are no other dependencies.
@@ -1,6 +1,6 @@
1
1
  [Maruku]: http://maruku.rubyforge.org
2
2
  [PHP Markdown Extra]: http://michelf.com/projects/php-markdown/extra/
3
3
  [Pandoc]: http://johnmacfarlane.net/pandoc/
4
- [jsMath]: http://www.math.union.edu/~dpvc/jsMath/
4
+ [MathJax]: http://www.mathjax.org
5
5
  [BlueCloth]: http://deveiate.org/projects/BlueCloth
6
6
  [RedCloth]: http://redcloth.org/
@@ -16,8 +16,8 @@ given. However, a link to the detailed syntax for each element is provided (whic
16
16
  differences to the standard Markdown syntax). The quick reference is for version **<%=
17
17
  ::Kramdown::VERSION %>** of the syntax documentation.
18
18
 
19
- kramdown has two main classes of elements: block and span level elements. Block level elements are
20
- used to create paragraphs, headers, lists and so on whereas span level elements are used to markup
19
+ kramdown has two main classes of elements: block and span-level elements. Block-level elements are
20
+ used to create paragraphs, headers, lists and so on whereas span-level elements are used to markup
21
21
  text phrases as emphasized, as a link and so on.
22
22
 
23
23
  All examples below feature the kramdown source, the converted HTML source and the output as it
@@ -33,7 +33,7 @@ Live browser view of example code
33
33
  <div class="clear"></div>
34
34
 
35
35
 
36
- # Block Level Elements - Main Structural Elements
36
+ # Block-level Elements - Main Structural Elements
37
37
 
38
38
  ## Paragraphs
39
39
 
@@ -99,7 +99,7 @@ If you set the option `auto_ids` to `false` (for example, by using the `options`
99
99
  {kdlink: {oid: blockquotes, part: "blockquotes"}}
100
100
 
101
101
  A blockquote is started using the `>` marker followed by an optional space; all following lines that
102
- are also started with the blockquote marker belong to the blockquote. You can use any block level
102
+ are also started with the blockquote marker belong to the blockquote. You can use any block-level
103
103
  elements inside a blockquote:
104
104
 
105
105
  {kdexample::}
@@ -159,7 +159,7 @@ underscores, optionally separated by spaces or tabs, on an otherwise blank line:
159
159
  {kdlink: {oid: lists, part: "lists"}}
160
160
 
161
161
  kramdown supports ordered and unordered lists. Ordered lists are started by using a number followed
162
- by a period, a space and then the list item text. The content of a list item consists of block level
162
+ by a period, a space and then the list item text. The content of a list item consists of block-level
163
163
  elements. All lines which have the same indent as the text of the line with the list marker belong
164
164
  to the list item:
165
165
 
@@ -170,7 +170,7 @@ to the list item:
170
170
  with additional. text
171
171
  {kdexample}
172
172
 
173
- As the content consists of block level elements you can do things like the following:
173
+ As the content consists of block-level elements you can do things like the following:
174
174
 
175
175
  {kdexample::}
176
176
  1. This is a list item
@@ -192,7 +192,7 @@ Nested lists are also easy to create:
192
192
  2. Item two
193
193
  {kdexample}
194
194
 
195
- Lists can occur directly after other block level elements, however, there has to be at least one
195
+ Lists can occur directly after other block-level elements, however, there has to be at least one
196
196
  blank line if you want to follow a paragraph with a list:
197
197
 
198
198
  {kdexample::}
@@ -240,8 +240,8 @@ term
240
240
  : definition
241
241
  {kdexample}
242
242
 
243
- Each term can be styled using span level elements and each definition is parsed as block level
244
- elements, i.e. you can use any block level in a definition. Just use the same indent for the lines
243
+ Each term can be styled using span-level elements and each definition is parsed as block-level
244
+ elements, i.e. you can use any block-level in a definition. Just use the same indent for the lines
245
245
  following the definition line:
246
246
 
247
247
  {kdexample::}
@@ -288,11 +288,11 @@ footer.
288
288
 
289
289
  {kdlink: {oid: html-blocks, part: "HTML blocks"}}
290
290
 
291
- kramdown allows you to use block level HTML tags (`div`, `p`, `pre`, ...) to markup whole blocks of
292
- text -- just start a line with a block level HTML tag. kramdown syntax is normally not processed
291
+ kramdown allows you to use block-level HTML tags (`div`, `p`, `pre`, ...) to markup whole blocks of
292
+ text -- just start a line with a block-level HTML tag. kramdown syntax is normally not processed
293
293
  inside an HTML tag but this can be changed with the `parse_block_html` option. If this options is
294
- set to `true`, then the content of a block level HTML tag is parsed by kramdown either as block
295
- level or span level text, depending on the tag:
294
+ set to `true`, then the content of a block-level HTML tag is parsed by kramdown either as block
295
+ level or span-level text, depending on the tag:
296
296
 
297
297
  {kdexample::}
298
298
  <div style="float: right">
@@ -313,7 +313,7 @@ This can contain only *span* level elements.
313
313
  {kdlink: {oid: block-ials, part: "block IALs"}}
314
314
  {kdlink: {oid: attribute-list-definitions, part: "ALDs"}}
315
315
 
316
- You can assign any attribute to a block level element. Just directly follow the block with a *block
316
+ You can assign any attribute to a block-level element. Just directly follow the block with a *block
317
317
  inline attribute list* (or short: block IAL). A block IAL consists of a left curly brace, followed
318
318
  by a colon, the attribute definitions and a right curly brace. Here is a simple example which sets the
319
319
  `title` attribute of a block quote:
@@ -398,7 +398,7 @@ before the closing brace:
398
398
 
399
399
 
400
400
 
401
- # Span Level Elements - Text Modifiers
401
+ # Span-Level Elements - Text Modifiers
402
402
 
403
403
  ## Emphasis
404
404
 
@@ -507,7 +507,7 @@ footnote[^1].
507
507
  [^1]: And here is the definition.
508
508
  {kdexample}
509
509
 
510
- The footnote definition can contain any block level element, all lines following a footnote
510
+ The footnote definition can contain any block-level element, all lines following a footnote
511
511
  definition indented with four spaces or one tab belong to the definition:
512
512
 
513
513
  {kdexample::}
@@ -543,7 +543,7 @@ example.
543
543
 
544
544
  {kdlink: {oid: html-spans, part: "HTML spans"}}
545
545
 
546
- HTML is not only supported on the block level but also on the span level:
546
+ HTML is not only supported on the block-level but also on the span-level:
547
547
 
548
548
  {kdexample::}
549
549
  This is <span style="color: red">written in
@@ -555,9 +555,9 @@ red</span>.
555
555
 
556
556
  {kdlink: {oid: span-ials, part: "span IALs"}}
557
557
 
558
- As with a block level element you can assign any attribute to a span level elements using a *span
558
+ As with a block-level element you can assign any attribute to a span-level elements using a *span
559
559
  inline attribute list* (or short: span IAL). A span IAL has the same syntax as a block IAL and must
560
- immediately follow the span level element:
560
+ immediately follow the span-level element:
561
561
 
562
562
  {kdexample::}
563
563
  This is *red*{: style="color: red"}.
@@ -28,23 +28,23 @@ document is converted.
28
28
  A kramdown document may be in any encoding, for example ASCII, UTF-8 or ISO-8859-1, and the output
29
29
  will have the same encoding as the source.
30
30
 
31
- The document consists of two types of elements, block level elements and span level elements:
31
+ The document consists of two types of elements, block-level elements and span-level elements:
32
32
 
33
- * Block level elements define the main structure of the content, for example, what part of the text
33
+ * Block-level elements define the main structure of the content, for example, what part of the text
34
34
  should be a paragraph, a list, a blockquote and so on.
35
35
 
36
- * Span level elements mark up small text parts as, for example, emphasized text or a link.
36
+ * Span-level elements mark up small text parts as, for example, emphasized text or a link.
37
37
 
38
- Thus span level elements can only occur inside block level elements or other span level elements.
38
+ Thus span-level elements can only occur inside block-level elements or other span-level elements.
39
39
 
40
- You will often find references to the "first column" or "first character" of a line in a block level
40
+ You will often find references to the "first column" or "first character" of a line in a block-level
41
41
  element descriptions. Such a reference is always to be taken relative to the current indentation
42
- level because some block level elements open up a new indentation level (e.g. blockquotes). The
42
+ level because some block-level elements open up a new indentation level (e.g. blockquotes). The
43
43
  beginning of a kramdown document opens up the default indentation level which begins at the first
44
44
  column of the text.
45
45
 
46
46
 
47
- ## Line Wrapping
47
+ ### Line Wrapping
48
48
 
49
49
  Some lightweight markup syntax don't work well in environments where lines are hard-wrapped. For
50
50
  example, this is the case with many email programs. Therefore kramdown allows content like
@@ -52,18 +52,37 @@ paragraphs or blockquotes to be hard-wrapped, i.e. broken across lines. This is
52
52
  to as "lazy syntax" since the indentation or line prefix required for the first line of content is
53
53
  not required for the consecutive lines.
54
54
 
55
- Block level elements that support line wrapping always end when one of the following conditions is
56
- encountered:
55
+ Block-level elements that support line wrapping always end when one of the following conditions is
56
+ met:
57
57
 
58
58
  * a [blank line](#blank-lines), an [EOB marker line](#eob-marker), a [block IAL](#block-ials) or the
59
59
  end of the document (i.e. a [block boundary](#block-boundaries)),
60
60
 
61
61
  * or an [HTML block](#html-blocks).
62
62
 
63
- Line wrapping is allowed throughout a kramdown document. There is one exception, however:
64
- [headers](#headers) may not be wrapped across lines. This is not an issue in most situations since
65
- headers normally fit on one line. If a header text gets too long for one line, use HTML syntax
66
- instead.
63
+ Line wrapping is allowed throughout a kramdown document but there are some block-level elements that
64
+ do *not* support being hard-wrapped:
65
+
66
+ [headers](#headers)
67
+
68
+ : This is not an issue in most situations since headers normally fit on one line. If a header text
69
+ gets too long for one line, you need to use HTML syntax instead.
70
+
71
+ [fenced code blocks](#fenced-code-blocks)
72
+
73
+ : The delimiting lines of a fenced code block do not support hard-wrapping. Since everything between
74
+ the delimiting lines is taken as is, the content of a fenced code block does also not support
75
+ hard-wrapping.
76
+
77
+ [definition list terms](#definition-lists)
78
+
79
+ : Each definition term has to appear on a separate line. Hard-wrapping would therefore introduce
80
+ additional definition terms. The definitions themselves, however, do support hard-wrapping.
81
+
82
+ [tables](#tables)
83
+
84
+ : Since each line of a kramdown table describes one table row or a separator, it is not possible to
85
+ hard-wrap tables.
67
86
 
68
87
  **Note** that it is **NOT** recommended to use lazy syntax to write a kramdown document. The
69
88
  flexibility that the kramdown syntax offers due to the issue of line wrapping hinders readability
@@ -90,7 +109,7 @@ HTML tags which use one of the characters, the result will be correct nonetheles
90
109
 
91
110
  Since kramdown also uses some characters to mark-up the text, there needs to be a way to escape
92
111
  these special characters so that they can have their normal meaning. This can be done by using
93
- backslash escapes. For example, you can use a literal backtick like this:
112
+ backslash escapes. For example, you can use a literal back tick like this:
94
113
 
95
114
  This \`is not a code\` span!
96
115
 
@@ -103,8 +122,8 @@ Following is a list of all the characters (character sequences) that can be esca
103
122
  + plus
104
123
  - minus
105
124
  = equal sign
106
- ` backtick
107
- ()[]{} left and right parens/brackets/braces
125
+ ` back tick
126
+ ()[]{}<> left and right parens/brackets/braces/angle brackets
108
127
  # hash
109
128
  ! bang
110
129
  << left guillemet
@@ -118,14 +137,14 @@ Following is a list of all the characters (character sequences) that can be esca
118
137
 
119
138
  ## Block Boundaries
120
139
 
121
- Some block level elements have to start and/or end on so called block boundaries, as stated in their
140
+ Some block-level elements have to start and/or end on so called block boundaries, as stated in their
122
141
  documentation. There are two cases where block boundaries come into play:
123
142
 
124
- * If a block level element has to start on a block boundary, it has to be preceded by either a
143
+ * If a block-level element has to start on a block boundary, it has to be preceded by either a
125
144
  [blank line](#blank-lines), an [EOB marker](#eob-marker), a [block IAL](#block-ials) or it has to
126
145
  be the first element.
127
146
 
128
- * If a block level element has to end on a block boundary, it has to be followed by either a [blank
147
+ * If a block-level element has to end on a block boundary, it has to be followed by either a [blank
129
148
  line](#blank-lines), an [EOB marker](#eob-marker), a [block IAL](#block-ials) or it has to be the
130
149
  last element.
131
150
 
@@ -133,7 +152,7 @@ documentation. There are two cases where block boundaries come into play:
133
152
 
134
153
  # Structural Elements
135
154
 
136
- All structural elements are block level elements and they are used to structure the content. They
155
+ All structural elements are block-level elements and they are used to structure the content. They
137
156
  can mark up some text as, for example, a simple paragraph, a quote or as a list item.
138
157
 
139
158
 
@@ -141,7 +160,7 @@ can mark up some text as, for example, a simple paragraph, a quote or as a list
141
160
 
142
161
  Any line that just contains white space characters such as spaces and tabs is considered a blank
143
162
  line by kramdown. One or more consecutive blank lines are handled as one empty blank line. Blank
144
- lines are used to separate block level elements from each other and in this case they don't have
163
+ lines are used to separate block-level elements from each other and in this case they don't have
145
164
  semantic meaning. However, there are some cases where blank lines do have a semantic meaning:
146
165
 
147
166
  * When used in headers -- see the [headers section](#headers)
@@ -153,7 +172,7 @@ semantic meaning. However, there are some cases where blank lines do have a sema
153
172
 
154
173
  ## Paragraphs
155
174
 
156
- Paragraphs are the most used block level elements. One or more consecutive lines of text are
175
+ Paragraphs are the most used block-level elements. One or more consecutive lines of text are
157
176
  interpreted as one paragraph. The first line of a paragraph may be indented up to three spaces, the
158
177
  other lines can have any amount of indentation because paragraphs support [line
159
178
  wrapping](#line-wrapping). In addition to the rules outlined in the section about line wrapping, a
@@ -279,7 +298,7 @@ blockquote. The marker itself may be indented up to three spaces. All following
279
298
  are started with the blockquote marker or just contain text, belong to the blockquote because
280
299
  blockquotes support [line wrapping](#line-wrapping).
281
300
 
282
- The contents of a blockquote are block level elements. This means that if you are just using text as
301
+ The contents of a blockquote are block-level elements. This means that if you are just using text as
283
302
  content that it will be wrapped in a paragraph. For example, the following gives you one blockquote
284
303
  with two paragraphs in it:
285
304
 
@@ -289,8 +308,8 @@ with two paragraphs in it:
289
308
  >
290
309
  > This is the second paragraph.
291
310
 
292
- Since the contents of a blockquote are block level elements, you can nest blockquotes and use other
293
- block level elements (this is also the reason why blockquotes need to support line wrapping):
311
+ Since the contents of a blockquote are block-level elements, you can nest blockquotes and use other
312
+ block-level elements (this is also the reason why blockquotes need to support line wrapping):
294
313
 
295
314
  > This is a paragraph.
296
315
  >
@@ -300,10 +319,10 @@ block level elements (this is also the reason why blockquotes need to support li
300
319
  >
301
320
  > * lists too
302
321
  >
303
- > and all other block level elements
322
+ > and all other block-level elements
304
323
 
305
324
  Note that the first space character after the `>` marker does *not* count when counting spaces for
306
- the indentation of the block level elements inside the blockquote! So [code blocks](#code-blocks)
325
+ the indentation of the block-level elements inside the blockquote! So [code blocks](#code-blocks)
307
326
  will have to be indented with five spaces or one space and one tab, like this:
308
327
 
309
328
  > A code block:
@@ -419,20 +438,20 @@ The first list marker in a list may be indented up to three spaces. The column n
419
438
  non-space character which appears after the list item marker on the same line specifies the
420
439
  indentation that has to be used for the following lines of content of the list item. If there is no
421
440
  such character, the indentation that needs to be used is four spaces or one tab. Indented lines may
422
- be followed by lines containg text with any amount of indentation due to [line
441
+ be followed by lines containing text with any amount of indentation due to [line
423
442
  wrapping](#line-wrapping). Note, however, that in addition to the rules outlined in the section
424
443
  about line wrapping, a list item also ends when a line with another list item marker is encountered
425
444
  -- see the next paragraph.
426
445
 
427
446
  The indentation is stripped from the content and the content (note that the content naturally also
428
- contains the content of the line with the item marker) is processed as text containing block level
447
+ contains the content of the line with the item marker) is processed as text containing block-level
429
448
  elements. All other list markers in the list may be indented up to three spaces or the number of
430
449
  spaces used for the indentation of the last list item minus one, whichever number is smaller. For
431
450
  example:
432
451
 
433
452
  * This is the first line. Since the first non-space characters appears in column 3, all other
434
453
  indented lines have to be indented 2 spaces.
435
- However, one could be lazy and not indent a line but this is not recommened.
454
+ However, one could be lazy and not indent a line but this is not recommended.
436
455
  * This is the another item of the list. It uses a different number of spaces for
437
456
  indentation which is okay but should generally be avoided.
438
457
  * The list item marker is indented 3 spaces which is allowed but should also be avoided and
@@ -469,7 +488,7 @@ example:
469
488
  It is clear that you might get unexpected results if you mix tabs and spaces or if you don't have
470
489
  the tab stops set to multiples of four in your editor! Therefore this should be avoided!
471
490
 
472
- The content of a list item is made up of either text or block level elements. Simple list items only
491
+ The content of a list item is made up of either text or block-level elements. Simple list items only
473
492
  contain text like in the above examples. They are not even wrapped in a paragraph tag. If the first
474
493
  list text is followed by one or more blank lines, it will be wrapped in a paragraph tag:
475
494
 
@@ -503,14 +522,14 @@ a proper paragraph as first element. This makes the following use case work like
503
522
 
504
523
  > The original Markdown syntax page specifies that list items which are separated by one or more
505
524
  > blank lines are wrapped in paragraph tags. This means that the first text will also be wrapped in
506
- > a paragraph if you have block level elements in a list which are separated by blank lines. The
525
+ > a paragraph if you have block-level elements in a list which are separated by blank lines. The
507
526
  > above rule is easy to remember and lets you exactly specify when the first list text should be
508
527
  > wrapped in a paragraph. The idea for the above rule comes from the [Pandoc] package.
509
528
  {: .markdown-difference}
510
529
 
511
530
  As seen in the examples above, blank lines between list items are allowed.
512
531
 
513
- Since the content of a list item can contain block level elements, you can do the following:
532
+ Since the content of a list item can contain block-level elements, you can do the following:
514
533
 
515
534
  * First item
516
535
 
@@ -531,7 +550,7 @@ can use an EOB marker to circumvent this problem:
531
550
  ^
532
551
  A code block following the list item.
533
552
 
534
- You can have any block level element as first element in a list item. However, as described above,
553
+ You can have any block-level element as first element in a list item. However, as described above,
535
554
  the leading tabs or spaces of the line with the list item marker are stripped away. This leads to a
536
555
  problem when you want to have a code block as first element. The solution to this problem is the
537
556
  following construct:
@@ -595,7 +614,7 @@ then the first part of the definition. The line with the definition marker may o
595
614
  separated from the preceding paragraph by a blank line. The leading tabs or spaces are stripped away
596
615
  from this first line of the definition to allow for a nice alignment with the following definition
597
616
  content. Each line of the preceding paragraph is taken to be a term and the lines separately parsed
598
- as span level elements.
617
+ as span-level elements.
599
618
 
600
619
  The following is a simple definition list:
601
620
 
@@ -608,7 +627,7 @@ The following is a simple definition list:
608
627
  The column number of the first non-space character which appears after a definition marker on the
609
628
  same line specifies the indentation that has to be used for the following lines of the definition.
610
629
  If there is no such character, the indentation that needs to be used is four spaces or one tab.
611
- Indented lines may be followed by lines containg text with any amount of indentation due to [line
630
+ Indented lines may be followed by lines containing text with any amount of indentation due to [line
612
631
  wrapping](#line-wrapping). Note, however, that in addition to the rules outlined in the section
613
632
  about line wrapping, a list item also ends when a line with another definition marker is encountered.
614
633
 
@@ -631,7 +650,7 @@ So, while the above is possible and creates a definition list with two terms and
631
650
  for them, it is not advised to use different (definition marker and definition) indents in the same
632
651
  definition list as well as lazy indentation!
633
652
 
634
- The definition for a term is made up of text and/or block level elements. If a definition is *not*
653
+ The definition for a term is made up of text and/or block-level elements. If a definition is *not*
635
654
  preceded by a blank line, the first part of the definition will just be text if it would be a
636
655
  paragraph otherwise:
637
656
 
@@ -639,11 +658,11 @@ paragraph otherwise:
639
658
  : This definition will just be text because it would normally be a paragraph and the there is
640
659
  no preceding blank line.
641
660
 
642
- > although the definition contains other block level elements
661
+ > although the definition contains other block-level elements
643
662
 
644
663
  : This definition *will* be a paragraph since it is preceded by a blank line.
645
664
 
646
- The rules about having any block level element as first element in a list item also apply to a
665
+ The rules about having any block-level element as first element in a list item also apply to a
647
666
  definition.
648
667
 
649
668
 
@@ -668,12 +687,12 @@ There are four different line types that can be used in a table:
668
687
  * *Table rows* define the content of a table.
669
688
 
670
689
  A table row is any line that contains at least one pipe character and is not identified as any
671
- other type of table line! The table row is divided into indivdual table cells by pipe characters.
690
+ other type of table line! The table row is divided into individual table cells by pipe characters.
672
691
  An optional trailing pipe character is ignored.
673
692
 
674
693
  Header rows, footer rows and normal rows are all done using these table rows. Table cells can only
675
- contain a single line of text, no multiline text is supported. The text of a table cell is parsed
676
- as span level elements. Note that literal pipe characters need to be escaped, even if they occur
694
+ contain a single line of text, no multi-line text is supported. The text of a table cell is parsed
695
+ as span-level elements. Note that literal pipe characters need to be escaped except if they occur
677
696
  in code spans!
678
697
 
679
698
  Here are some example table rows:
@@ -761,7 +780,7 @@ Also note
761
780
  > * kramdown tables do not need to have a table header.
762
781
  > * kramdown tables can be structured using separator lines.
763
782
  > * kramdown tables can contain a table footer.
764
- > * kramdown tables need to be separted from other block level elements.
783
+ > * kramdown tables need to be separated from other block-level elements.
765
784
  {: .markdown-difference}
766
785
 
767
786
  Here is an example for a kramdown table with a table header row, two table bodies and a table footer
@@ -818,7 +837,7 @@ three spaces. The following examples show different possibilities to create a ho
818
837
  > and [Pandoc] packages.
819
838
  {: .markdown-difference}
820
839
 
821
- kramdown has built-in support for block and span level mathematics written in LaTeX.
840
+ kramdown has built-in support for block and span-level mathematics written in LaTeX.
822
841
 
823
842
  A math block needs to start and end on [block boundaries](#block-boundaries). It is started using
824
843
  two dollar signs, optionally indented up to three spaces. The math block continues until the next
@@ -884,7 +903,7 @@ the beginning of a paragraph, just escape the first dollar sign.
884
903
  An HTML block is potentially started if a line is encountered that begins with a non-span-level HTML
885
904
  tag or a general XML tag (opening or closing) which may be indented up to three spaces.
886
905
 
887
- The following HTML tags count as span level HTML tags and *won't* start an HTML block if found at
906
+ The following HTML tags count as span-level HTML tags and *won't* start an HTML block if found at
888
907
  the beginning of an HTML block line:
889
908
 
890
909
  a abbr acronym b big bdo br button cite code del dfn em i img input
@@ -904,16 +923,16 @@ content is parsed:
904
923
  instead of `<hr>` (although kramdown tries to fix such things if possible). If an invalid closing
905
924
  tag is found, it is ignored.
906
925
 
907
- * Parse as block level elements: If the HTML/XML tag content should be parsed as text containing
908
- block level elements, the remaining text on the line will be parsed by the block level parser as
926
+ * Parse as block-level elements: If the HTML/XML tag content should be parsed as text containing
927
+ block-level elements, the remaining text on the line will be parsed by the block-level parser as
909
928
  if it appears on a separate line (**Caution**: This also means that if the line consists of the
910
929
  start tag, text and the end tag, the end tag will not be found!). All following lines are parsed
911
- as block level elements until an HTML block line with the matching end tag is found or until the
930
+ as block-level elements until an HTML block line with the matching end tag is found or until the
912
931
  end of the document.
913
932
 
914
- * Parse as span level elements: If the HTML/XML tag content should be parsed as text containing span
933
+ * Parse as span-level elements: If the HTML/XML tag content should be parsed as text containing span
915
934
  level elements, then all text until the *next* matching end tag or until the end of the document
916
- will be the content of the tag and will later be parsed by the span level parser. This also means
935
+ will be the content of the tag and will later be parsed by the span-level parser. This also means
917
936
  that if the matching end tag is inside what appears to be a code span, it is still used!
918
937
 
919
938
  If there is text after an end tag, it will be parsed as if it appears on a separate line except when
@@ -946,19 +965,19 @@ Parse as raw HTML block
946
965
 
947
966
  Also, all general XML tags are parsed as raw HTML blocks.
948
967
 
949
- Parse as block level elements
968
+ Parse as block-level elements
950
969
  :
951
970
  applet button blockquote body colgroup dd div dl fieldset form iframe li
952
971
  map noscript object ol table tbody thead tfoot tr td ul
953
972
 
954
- Parse as span level elements
973
+ Parse as span-level elements
955
974
  :
956
975
  a abbr acronym address b bdo big cite caption code del dfn dt em
957
976
  h1 h2 h3 h4 h5 h6 i ins kbd label legend optgroup p pre q rb rbc
958
977
  rp rt rtc ruby samp select small span strong sub sup th tt var
959
978
 
960
- > Remember that all span level HTML tags like `a` or `b` do not start a HTML block! However, the
961
- > above lists also include span level HTML tags in the case the `markdown` attribute is used on a
979
+ > Remember that all span-level HTML tags like `a` or `b` do not start a HTML block! However, the
980
+ > above lists also include span-level HTML tags in the case the `markdown` attribute is used on a
962
981
  > tag inside a raw HTML block.
963
982
 
964
983
  Here is a simple example input and its HTML output with `parse_block_html` set to `false`:
@@ -977,7 +996,7 @@ Here is a simple example input and its HTML output with `parse_block_html` set t
977
996
 
978
997
  As one can see the content of the `div` tag will be parsed as raw HTML block and left alone.
979
998
  However, if the `markdown="1"` attribute was used on the `div` tag, the content would be parsed as
980
- block level elements and therefore converted to a paragraph.
999
+ block-level elements and therefore converted to a paragraph.
981
1000
 
982
1001
  You can also use several HTML tags at once:
983
1002
 
@@ -988,23 +1007,23 @@ You can also use several HTML tags at once:
988
1007
  </div></div>
989
1008
  This is a para outside the HTML block.
990
1009
 
991
- However, remember that if the content of a tag is parsed as block level elements, the content that
1010
+ However, remember that if the content of a tag is parsed as block-level elements, the content that
992
1011
  appears after a start/end tag but on the same line, is processed as if it appears on a new line:
993
1012
 
994
1013
  <div markdown="1">This is the first part of a para,
995
1014
  which is continued here.
996
1015
  </div>
997
1016
 
998
- <p markdown="1">This works without problems because it is parsed as span level elements</p>
1017
+ <p markdown="1">This works without problems because it is parsed as span-level elements</p>
999
1018
 
1000
1019
  <div markdown="1">The end tag is not found because
1001
1020
  this line is parsed as a paragraph</div>
1002
1021
 
1003
1022
  Since setting `parse_block_html` to `true` can lead to some not wanted behaviour, it is generally
1004
- better to selectively enable or disable block/span level elements parsing by using the `markdown`
1023
+ better to selectively enable or disable block/span-level elements parsing by using the `markdown`
1005
1024
  attribute!
1006
1025
 
1007
- Unclosed block level HTML tags are correctly closed at the end of the document to ensure correct
1026
+ Unclosed block-level HTML tags are correctly closed at the end of the document to ensure correct
1008
1027
  nesting and invalidly used end tags are removed from the output:
1009
1028
 
1010
1029
  This is a para.
@@ -1034,19 +1053,19 @@ comments is not processed:
1034
1053
 
1035
1054
  # Text Markup
1036
1055
 
1037
- These elements are all span level elements and used inside block level elements to markup text
1056
+ These elements are all span-level elements and used inside block-level elements to markup text
1038
1057
  fragments. For example, one can easily create links or apply emphasis to certain text parts.
1039
1058
 
1040
- Note that empty span level elements are not converted to empty HTML tags but are copied as-is to the
1059
+ Note that empty span-level elements are not converted to empty HTML tags but are copied as-is to the
1041
1060
  output.
1042
1061
 
1043
1062
 
1044
1063
 
1045
1064
  ## Links and Images
1046
1065
 
1047
- Three types of links are supported: autolinks, inline links and reference links.
1066
+ Three types of links are supported: automatic links, inline links and reference links.
1048
1067
 
1049
- ### Autolinks
1068
+ ### Automatic Links
1050
1069
 
1051
1070
  This is the easiest one to create: Just surround a web address or an email address with angle
1052
1071
  brackets and the address will be turned into a proper link. The address will be used as link target
@@ -1055,8 +1074,8 @@ and as link text. For example:
1055
1074
  Information can be found on the <http://example.com> homepage.
1056
1075
  You can also mail me: <me.example@example.com>
1057
1076
 
1058
- It is not possible to specify a different link text using autolinks -- use the other link types for
1059
- this!
1077
+ It is not possible to specify a different link text using automatic links -- use the other link
1078
+ types for this!
1060
1079
 
1061
1080
 
1062
1081
  ### Inline Links
@@ -1075,7 +1094,7 @@ single or double quotes preceded by at least one space) in normal parentheses. F
1075
1094
 
1076
1095
  Notes:
1077
1096
 
1078
- * The link text is treated like normal span level text and therefore is parsed and converted.
1097
+ * The link text is treated like normal span-level text and therefore is parsed and converted.
1079
1098
  However, if you use square brackets within the link text, you have to either properly nest them or
1080
1099
  to escape them. It is not possible to create nested links!
1081
1100
 
@@ -1109,7 +1128,7 @@ definition looks like this:
1109
1128
 
1110
1129
  [linkid]: http://www.example.com/ "Optional Title"
1111
1130
 
1112
- > Link definitions are, despite being described here, non-content block level elements.
1131
+ > Link definitions are, despite being described here, non-content block-level elements.
1113
1132
  {: .information}
1114
1133
 
1115
1134
  The link definition has the following structure:
@@ -1177,7 +1196,7 @@ want to force the literal meaning of an asterisk or an underscore you can backsl
1177
1196
 
1178
1197
  ## Code Spans
1179
1198
 
1180
- This is the span level equivalent of the code block element. You can markup a text part as code span
1199
+ This is the span-level equivalent of the code block element. You can markup a text part as code span
1181
1200
  by surrounding it with backticks `` ` ``. For example:
1182
1201
 
1183
1202
  Use `<html>` tags for this.
@@ -1202,8 +1221,8 @@ literal meaning of a backtick you can backslash-escape it:
1202
1221
 
1203
1222
  ## HTML Spans
1204
1223
 
1205
- HTML tags cannot only be used on the block level but also on the span level. Span level HTML tags
1206
- can only be used inside one block level element, it is not possible to use a start tag in one block
1224
+ HTML tags cannot only be used on the block-level but also on the span-level. Span-level HTML tags
1225
+ can only be used inside one block-level element, it is not possible to use a start tag in one block
1207
1226
  level element and the end tag in another. Note that only correct XHTML is supported! This means that
1208
1227
  you have to use, for example, `<br />` instead of `<br>` (although kramdown tries to fix such errors
1209
1228
  if possible).
@@ -1220,23 +1239,23 @@ enable/disable syntax parsing on a tag per tag basis using the `markdown` attrib
1220
1239
  level elements.
1221
1240
 
1222
1241
  * If an HTML tag has an attribute `markdown="block"`, then a warning is issued because HTML spans
1223
- cannot contain block level elements and the attribute is ignored.
1242
+ cannot contain block-level elements and the attribute is ignored.
1224
1243
 
1225
1244
  * If an HTML tag has an attribute `markdown="span"`, then the content of the tag is parsed as span
1226
1245
  level elements.
1227
1246
 
1228
- The content of a span level HTML tag is normally parsed as span level elements. Note, however, that
1247
+ The content of a span-level HTML tag is normally parsed as span-level elements. Note, however, that
1229
1248
  some tags like `<script>` are not parsed, i.e. their content is not modified.
1230
1249
 
1231
1250
  Processing instructions and XML comments can also be used (their content is not parsed). However, as
1232
- with HTML tags the start and the end have to appear in the same block level element.
1251
+ with HTML tags the start and the end have to appear in the same block-level element.
1233
1252
 
1234
- Span level PIs and span level XML comments as well as general span level HTML and XML tags have to
1253
+ Span-level PIs and span-level XML comments as well as general span-level HTML and XML tags have to
1235
1254
  be preceded by at least one non whitespace character on the same line so that kramdown correctly
1236
- recognizes them as span level element and not as block level element. However, all span HTML tags,
1255
+ recognizes them as span-level element and not as block-level element. However, all span HTML tags,
1237
1256
  i.e. `a`, `em`, `b`, ..., (opening or closing) can appear at the start of a line.
1238
1257
 
1239
- Unclosed span level HTML tags are correctly closed at the end of the span level text to ensure
1258
+ Unclosed span-level HTML tags are correctly closed at the end of the span-level text to ensure
1240
1259
  correct nesting and invalidly used end tags or block HTML tags are removed from the output:
1241
1260
 
1242
1261
  This is </invalid>.
@@ -1289,11 +1308,11 @@ A footnote definition is used to define the content of a footnote and has the fo
1289
1308
  blocks](#standard-code-blocks) (the leading four spaces/one tab are naturally stripped from the
1290
1309
  text)
1291
1310
 
1292
- > Footnote definitions are, despite being described here, non-content block level elements.
1311
+ > Footnote definitions are, despite being described here, non-content block-level elements.
1293
1312
  {: .information}
1294
1313
 
1295
- The whole footnote content is treated like block level text and can therefore contain any valid
1296
- block level element (also, any block level element can be the first element). If you want to have a
1314
+ The whole footnote content is treated like block-level text and can therefore contain any valid
1315
+ block-level element (also, any block-level element can be the first element). If you want to have a
1297
1316
  code block as first element, note that all leading spaces/tabs on the first line are stripped away.
1298
1317
  Here are some example footnote definitions:
1299
1318
 
@@ -1346,7 +1365,7 @@ Here are some examples:
1346
1365
  *[another language]: It's called Markdown
1347
1366
  *[HTML]: HyperTextMarkupLanguage
1348
1367
 
1349
- > Abbreviation definitions are, despite being described here, non-content block level elements.
1368
+ > Abbreviation definitions are, despite being described here, non-content block-level elements.
1350
1369
  {: .information}
1351
1370
 
1352
1371
 
@@ -1374,10 +1393,10 @@ they won't be replaced with fancy ones.
1374
1393
  # Non-content elements
1375
1394
 
1376
1395
  This section describes the non-content elements that are used in kramdown documents, i.e. elements
1377
- that don't provide content for the document but have other uses such as separating block level
1396
+ that don't provide content for the document but have other uses such as separating block-level
1378
1397
  elements or attaching attributes to elements.
1379
1398
 
1380
- Three non-content block level elements are not described here because they fit better where they
1399
+ Three non-content block-level elements are not described here because they fit better where they
1381
1400
  are:
1382
1401
 
1383
1402
  * [link definitions](#link-definitions)
@@ -1391,13 +1410,13 @@ are:
1391
1410
  {: .markdown-difference}
1392
1411
 
1393
1412
  The End-Of-Block (EOB) marker -- a `^` as first character on an otherwise empty line -- is a block
1394
- level element that can be used to specify the end of a block level element even if the block level
1395
- element, after which it is used, would continue otherwise. If there is no block level element to
1413
+ level element that can be used to specify the end of a block-level element even if the block-level
1414
+ element, after which it is used, would continue otherwise. If there is no block-level element to
1396
1415
  end, the EOB marker is simply ignored.
1397
1416
 
1398
1417
  You won't find an EOB marker in most kramdown documents but sometimes it is necessary to use it to
1399
1418
  achieve the wanted results which would be impossible otherwise. However, it should only be used when
1400
- absolutely necesary!
1419
+ absolutely necessary!
1401
1420
 
1402
1421
  For example, the following gives you one list with two items:
1403
1422
 
@@ -1418,11 +1437,11 @@ By using an EOB marker, you can make two lists with one item each:
1418
1437
  > the [Maruku] package.
1419
1438
  {: .markdown-difference}
1420
1439
 
1421
- This is an implementation of [Maruku]'s feature for adding attributes to block and span level
1422
- elements (the naming is also taken from Maruku). This block level element is used to define
1440
+ This is an implementation of [Maruku]'s feature for adding attributes to block and span-level
1441
+ elements (the naming is also taken from Maruku). This block-level element is used to define
1423
1442
  attributes which can be referenced later. The [Block Inline Attribute List](#block-ials) is used to
1424
- attach attributes to a block level element and the [Span Inline Attribute List](#span-ials) is used
1425
- to attach attributes to a span level element.
1443
+ attach attributes to a block-level element and the [Span Inline Attribute List](#span-ials) is used
1444
+ to attach attributes to a span-level element.
1426
1445
 
1427
1446
  Following are some examples of attribute list definitions (ALDs) and afterwards comes the syntax
1428
1447
  explanation:
@@ -1457,7 +1476,7 @@ key-value pairs
1457
1476
  : A key-value pair is defined by a key name, which must follow the rules for reference names, then
1458
1477
  an equal sign and then the value in single or double quotes. If you need to use the value
1459
1478
  delimiter (a single or a double quote) inside the value, you need to escape it with a backslash.
1460
- Key-value pairs can be used to specify arbitrary attributes for block or span level elements. For
1479
+ Key-value pairs can be used to specify arbitrary attributes for block or span-level elements. For
1461
1480
  example, a key-value pair looks like `key1="bef \"quoted\" aft"` or `title='This is a title'`.
1462
1481
 
1463
1482
  ID name
@@ -1465,7 +1484,7 @@ ID name
1465
1484
  : An ID name is defined by using a hash and then the identifier name which needs to start with a
1466
1485
  word character or a digit, optionally followed by other word characters, digits, dashes or colons.
1467
1486
  This is a short hand for the key-value pair `id="IDNAME"` since this is often used. The ID name
1468
- specifies the unique ID of a block or span level element. For example, an ID name looks like
1487
+ specifies the unique ID of a block or span-level element. For example, an ID name looks like
1469
1488
  `#myid`.
1470
1489
 
1471
1490
  class names
@@ -1498,11 +1517,11 @@ These elements are used to attach attributes to another element.
1498
1517
  > the [Maruku] package.
1499
1518
  {: .markdown-difference}
1500
1519
 
1501
- This block level element is used to attach attributes to a block level element. A block inline
1520
+ This block-level element is used to attach attributes to a block-level element. A block inline
1502
1521
  attribute list (block IAL) has the same structure as an [ALD](#attribute-list-definitions) except
1503
1522
  that the colon/reference name/colon part is replaced by a colon. A block IAL (or two or more block
1504
- IALs) has to be put directly before or after the block level element to which the attributes should
1505
- be attached. If a block IAL is directly after *and* before a block level element, it is applied to
1523
+ IALs) has to be put directly before or after the block-level element to which the attributes should
1524
+ be attached. If a block IAL is directly after *and* before a block-level element, it is applied to
1506
1525
  preceding element. The block IAL is ignored in all other cases, for example, when the block IAL is
1507
1526
  surrounded by blank lines.
1508
1527
 
@@ -1526,9 +1545,9 @@ Here are some examples for block IALs:
1526
1545
  > the [Maruku] package.
1527
1546
  {: .markdown-difference}
1528
1547
 
1529
- This is a version of the [block inline attribute list](#block-ials) for span level elements. It has
1548
+ This is a version of the [block inline attribute list](#block-ials) for span-level elements. It has
1530
1549
  the same structure as the block IAL except that leading and trailing spaces are not allowed. A span
1531
- IAL (or two or more span IALs) has to be put directly after the span level element to which it
1550
+ IAL (or two or more span IALs) has to be put directly after the span-level element to which it
1532
1551
  should be applied, no additional character is allowed between, otherwise it is ignored and only
1533
1552
  removed from the output.
1534
1553
 
@@ -1544,7 +1563,7 @@ Here are some examples for span IALs:
1544
1563
  {: .markdown-difference}
1545
1564
 
1546
1565
  Extensions provide additional functionality but use the same syntax for it. They are available as
1547
- block as well as span level elements.
1566
+ block as well as span-level elements.
1548
1567
 
1549
1568
  The syntax for an extension is very similar to the syntax of [ALDs](#attribute-list-definitions).
1550
1569
  Here are some examples of how to specify extensions and afterwards is the syntax definition:
@@ -1577,7 +1596,7 @@ The stop tag has the following structure:
1577
1596
 
1578
1597
  A stop tag is only needed if the extension has a body!
1579
1598
 
1580
- The above syntax can be used as is for span level extensions. The starting and ending lines for block level
1599
+ The above syntax can be used as is for span-level extensions. The starting and ending lines for block-level
1581
1600
  extensions are defined as:
1582
1601
 
1583
1602
  * The starting line consists of the extension start tag, optionally preceded by up to three spaces,