kramdown 1.1.0 → 1.2.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 (36) hide show
  1. checksums.yaml +6 -14
  2. data/CONTRIBUTERS +4 -2
  3. data/Rakefile +2 -2
  4. data/VERSION +1 -1
  5. data/data/kramdown/document.html +4 -0
  6. data/doc/documentation.page +1 -1
  7. data/doc/installation.page +2 -2
  8. data/doc/sidebar.template +2 -2
  9. data/doc/syntax.page +4 -5
  10. data/lib/kramdown/converter/base.rb +1 -1
  11. data/lib/kramdown/converter/html.rb +1 -1
  12. data/lib/kramdown/converter/latex.rb +2 -2
  13. data/lib/kramdown/parser.rb +1 -0
  14. data/lib/kramdown/parser/gfm.rb +40 -0
  15. data/lib/kramdown/parser/html.rb +1 -0
  16. data/lib/kramdown/parser/kramdown/codeblock.rb +4 -4
  17. data/lib/kramdown/parser/kramdown/extensions.rb +1 -1
  18. data/lib/kramdown/parser/kramdown/header.rb +1 -1
  19. data/lib/kramdown/utils/unidecoder.rb +8 -3
  20. data/lib/kramdown/version.rb +1 -1
  21. data/test/test_files.rb +74 -0
  22. data/test/testcases/block/03_paragraph/indented.html.gfm +18 -0
  23. data/test/testcases/block/04_header/atx_header.html +5 -1
  24. data/test/testcases/block/04_header/atx_header.text +5 -1
  25. data/test/testcases/block/04_header/setext_header.html +3 -1
  26. data/test/testcases/block/04_header/setext_header.text +4 -1
  27. data/test/testcases/block/07_horizontal_rule/normal.html +2 -0
  28. data/test/testcases/block/07_horizontal_rule/normal.text +3 -0
  29. data/test/testcases_gfm/backticks_disable_highlighting.html +2 -0
  30. data/test/testcases_gfm/backticks_disable_highlighting.options +1 -0
  31. data/test/testcases_gfm/backticks_disable_highlighting.text +3 -0
  32. data/test/testcases_gfm/backticks_syntax.html +20 -0
  33. data/test/testcases_gfm/backticks_syntax.text +19 -0
  34. data/test/testcases_gfm/two_para_hard_line_breaks.html +4 -0
  35. data/test/testcases_gfm/two_para_hard_line_breaks.text +4 -0
  36. metadata +16 -9
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- Yjk2ODI4N2MxZmExMmZjNzEzNzk3OThjNjFjYzA5NTQ4NmY0NjEwNg==
5
- data.tar.gz: !binary |-
6
- NTgwZjE3MDQ5NmE3OGEwYTdkMmFkOTdjMTFhMWZkYTczNDg2M2FkYg==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- ZmIzYWNkYzE2Mjg1MGNkM2E3MjM0YTNiMWI5Y2VkZmM2ZDdiNzJjNjdjMjU1
10
- MjlhNmFlNjRiODM0MjE4ODBmMzA5YjFjOTM4ZTdkOWViZTcxMTE3ZjUzNThk
11
- ZmMzZjRhOTlkMDM5NTY2NTNkMmEwNDhkY2RiZGUwNjQxOTRlMDU=
12
- data.tar.gz: !binary |-
13
- ZjI5NjUxZDZhOWRhZTA2MGEzOWUyZDg4NGI0OTZmZGU5M2RiM2U0ZTgwZGNi
14
- ZDRkMzk4NWE0ZGU2ZTI5YjBhNzBjNDA3NWQ0ZjZjM2Y2NDBhNWYwODk0ZWZj
15
- NDY5N2ZmYWI2ZTVlZWI1YTQ1NWQyNzU0N2JhODZmMWUyZGQxNjE=
2
+ SHA1:
3
+ metadata.gz: 32280f4fafeca55aeecb04530f975715e811f7f2
4
+ data.tar.gz: 093389e9fa3fcf20e987c12043377358ff03d632
5
+ SHA512:
6
+ metadata.gz: 62f5d75971e5d2a217d97638e9f961be1961d9d0f860a6b1bef082dd2471ae8207dd6eef5500a277ade27a02a60051c863a2d611f1973a3abfba0adf500b37b6
7
+ data.tar.gz: 78b3ec99523df42f35a0c3cbc264c2aa3b15ba4c6a9570b316673edc2d88edcb2c1d9e831afbddcd7c6bbd5ceac695f950bd8f94785275d020f1f7fef3c176ed
data/CONTRIBUTERS CHANGED
@@ -1,17 +1,19 @@
1
1
  Count Name
2
2
  ======= ====
3
- 592 Thomas Leitner <t_leitner@gmx.at>
3
+ 603 Thomas Leitner <t_leitner@gmx.at>
4
4
  6 Gioele Barabucci <gioele@svario.it>
5
5
  4 Ted Pak <powerpak006@gmail.com>
6
+ 4 Arne Brasseur <arne@arnebrasseur.net>
7
+ 3 Henning Perl <perl@fast-sicher.de>
6
8
  3 gettalong <t_leitner@gmx.at>
7
9
  3 Ben Armston <ben.armston@googlemail.com>
8
10
  3 Alex Marandon <contact@alexmarandon.com>
9
- 2 Henning Perl <perl@fast-sicher.de>
10
11
  2 Bran <m.versum@gmail.com>
11
12
  1 Trevor Wennblom <trevor@well.com>
12
13
  1 tomykaira <tomykaira@gmail.com>
13
14
  1 Tim Besard <tim.besard@gmail.com>
14
15
  1 Tim Bates <tim@rumpuslabs.com>
16
+ 1 Simon Lydell <simon.lydell@gmail.com>
15
17
  1 Postmodern <postmodern.mod3@gmail.com>
16
18
  1 myqlarson <myqlarson@gmail.com>
17
19
  1 Michal Till <michal.till@gmail.com>
data/Rakefile CHANGED
@@ -218,7 +218,7 @@ EOF
218
218
  rf.configure
219
219
  rf.login
220
220
 
221
- rf.userconfig["release_notes"] = REL_PAGE.blocks['content'].content.force_encoding("BINARY")
221
+ rf.userconfig["release_notes"] = REL_PAGE.blocks['content']
222
222
  rf.userconfig["preformatted"] = false
223
223
 
224
224
  files = %w[.gem .tgz .zip].collect {|ext| "pkg/kramdown-#{Kramdown::VERSION}" + ext}
@@ -239,7 +239,7 @@ EOF
239
239
 
240
240
  content = REL_PAGE.blocks['content']
241
241
  content += "\n\n\nAbout kramdown\n\n#{SUMMARY}\n\n#{DESCRIPTION}"
242
- rf.post_news('kramdown', "kramdown #{Kramdown::VERSION} released", content).force_encoding("BINARY")
242
+ rf.post_news('kramdown', "kramdown #{Kramdown::VERSION} released", content)
243
243
  puts "done"
244
244
  end
245
245
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.0
1
+ 1.2.0
@@ -1,5 +1,9 @@
1
+ <!DOCTYPE html>
1
2
  <html>
2
3
  <head>
4
+ <% if @converter.root.options[:encoding] %>
5
+ <meta http-equiv="Content-type" content="text/html;<%= @converter.root.options[:encoding] %>">
6
+ <% end %>
3
7
  <%
4
8
  extend ::Kramdown::Utils::Html
5
9
  title = ''
@@ -12,7 +12,7 @@ HTML. However, due to its modular architecture it is able to support additional
12
12
  formats. The following input and output formats are currently supported:
13
13
 
14
14
  * Input: [kramdown](parser/kramdown.html) (a superset of Markdown),
15
- [Markdown](parser/markdown.html), [HTML](parser/html.html)
15
+ [Markdown](parser/markdown.html), [Github Flavored Markdown](parser/gfm.html), [HTML](parser/html.html)
16
16
 
17
17
  * Output: [HTML](converter/html.html), [LaTeX](converter/latex.html),
18
18
  [kramdown](converter/kramdown.html), [RemoveHtmlTags](converter/remove_html_tags.html) (a special
@@ -8,7 +8,7 @@ sort_info: 5
8
8
  ## Dependencies
9
9
 
10
10
  Since kramdown is written in Ruby, you just need the [Ruby interpreter](http://www.ruby-lang.org),
11
- version 1.8.5, 1.8.6, 1.8.7, 1.9.2 or 1.9.3. There are no other dependencies.
11
+ version 1.8.5, 1.8.6, 1.8.7, 1.9.2, 1.9.3 or 2.0.0. There are no other dependencies.
12
12
 
13
13
 
14
14
  ## Compatibility Notes
@@ -16,7 +16,7 @@ version 1.8.5, 1.8.6, 1.8.7, 1.9.2 or 1.9.3. There are no other dependencies.
16
16
  kramdown should work on any platform which supports Ruby. It has been successfully tested on the
17
17
  following platforms:
18
18
 
19
- * Linux with Ruby 1.8.5, 1.8.6, 1.8.7, 1.9.2, 1.9.3 and jruby 1.6.0.
19
+ * Linux with Ruby 1.8.5, 1.8.6, 1.8.7, 1.9.2, 1.9.3, 2.0.0 and jruby 1.7.3.
20
20
 
21
21
  See the platform specific installation notes for more information!
22
22
 
data/doc/sidebar.template CHANGED
@@ -1,7 +1,7 @@
1
1
  <h2>News</h2>
2
2
 
3
- <p>The latest version of kramdown is <span class="inline-important">1.1.0</span> and it was released
4
- on <span class="inline-important">2013-07-02</span></p>
3
+ <p>The latest version of kramdown is <span class="inline-important">1.2.0</span> and it was released
4
+ on <span class="inline-important">2013-08-31</span></p>
5
5
 
6
6
  <p>More <a href="{relocatable: news.html}">news</a>…</p>
7
7
 
data/doc/syntax.page CHANGED
@@ -1543,11 +1543,10 @@ key-value pairs
1543
1543
 
1544
1544
  ID name
1545
1545
 
1546
- : An ID name is defined by using a hash and then the identifier name which needs to start with a
1547
- word character or a digit, optionally followed by other word characters, digits, dashes or colons.
1548
- This is a short hand for the key-value pair `id="IDNAME"` since this is often used. The ID name
1549
- specifies the unique ID of a block or span-level element. For example, an ID name looks like
1550
- `#myid`.
1546
+ : An ID name is defined by using a hash and then the identifier name which needs to start with an
1547
+ ASCII character, optionally followed by other ASCII characters, digits, dashes or colons. This is
1548
+ a short hand for the key-value pair `id="IDNAME"` since this is often used. The ID name specifies
1549
+ the unique ID of a block or span-level element. For example, an ID name looks like `#myid`.
1551
1550
 
1552
1551
  class names
1553
1552
 
@@ -77,8 +77,8 @@ module Kramdown
77
77
  def self.convert(tree, options = {})
78
78
  converter = new(tree, ::Kramdown::Options.merge(options.merge(tree.options[:options] || {})))
79
79
  result = converter.convert(tree)
80
- result = apply_template(converter, result) if !converter.options[:template].empty?
81
80
  result.encode!(tree.options[:encoding]) if result.respond_to?(:encode!)
81
+ result = apply_template(converter, result) if !converter.options[:template].empty?
82
82
  [result, converter.warnings]
83
83
  end
84
84
 
@@ -142,7 +142,7 @@ module Kramdown
142
142
  end
143
143
 
144
144
  def convert_hr(el, indent)
145
- "#{' '*indent}<hr />\n"
145
+ "#{' '*indent}<hr#{html_attributes(el.attr)} />\n"
146
146
  end
147
147
 
148
148
  def convert_ul(el, indent)
@@ -206,9 +206,9 @@ module Kramdown
206
206
  def convert_a(el, opts)
207
207
  url = el.attr['href']
208
208
  if url =~ /^#/
209
- "\\hyperlink{#{url[1..-1]}}{#{inner(el, opts)}}"
209
+ "\\hyperlink{#{escape(url[1..-1])}}{#{inner(el, opts)}}"
210
210
  else
211
- "\\href{#{url}}{#{inner(el, opts)}}"
211
+ "\\href{#{escape(url)}}{#{inner(el, opts)}}"
212
212
  end
213
213
  end
214
214
 
@@ -20,6 +20,7 @@ module Kramdown
20
20
  autoload :Kramdown, 'kramdown/parser/kramdown'
21
21
  autoload :Html, 'kramdown/parser/html'
22
22
  autoload :Markdown, 'kramdown/parser/markdown'
23
+ autoload :GFM, 'kramdown/parser/gfm'
23
24
 
24
25
  end
25
26
 
@@ -0,0 +1,40 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ require 'kramdown/parser/kramdown'
4
+
5
+ module Kramdown
6
+ module Parser
7
+ class GFM < Kramdown::Parser::Kramdown
8
+
9
+ def initialize(source, options)
10
+ super
11
+ i = @block_parsers.index(:codeblock_fenced)
12
+ @block_parsers.delete(:codeblock_fenced)
13
+ @block_parsers.insert(i, :codeblock_fenced_gfm)
14
+ end
15
+
16
+ FENCED_CODEBLOCK_MATCH = /^(([~`]){3,})\s*?(\w+)?\s*?\n(.*?)^\1\2*\s*?\n/m
17
+
18
+ define_parser(:codeblock_fenced_gfm, /^[~`]{3,}/, nil, 'parse_codeblock_fenced')
19
+
20
+ def parse_paragraph
21
+ result = @src.scan(PARAGRAPH_MATCH)
22
+ while !@src.match?(self.class::PARAGRAPH_END)
23
+ result << @src.scan(PARAGRAPH_MATCH)
24
+ end
25
+ result.chomp!
26
+ unless @tree.children.last && @tree.children.last.type == :p
27
+ @tree.children << new_block_el(:p)
28
+ end
29
+ lines = result.lstrip.split(/\n/)
30
+ lines.each_with_index do |line, index|
31
+ @tree.children.last.children << Element.new(@text_type, line) << Element.new(:br) << Element.new(@text_type, "\n")
32
+ end
33
+ @tree.children.last.children.pop # added one \n too many
34
+ @tree.children.last.children.pop # added one :br too many
35
+ true
36
+ end
37
+
38
+ end
39
+ end
40
+ end
@@ -9,6 +9,7 @@
9
9
 
10
10
  require 'rexml/parsers/baseparser'
11
11
  require 'strscan'
12
+ require 'kramdown/utils'
12
13
 
13
14
  module Kramdown
14
15
 
@@ -31,14 +31,14 @@ module Kramdown
31
31
 
32
32
 
33
33
  FENCED_CODEBLOCK_START = /^~{3,}/
34
- FENCED_CODEBLOCK_MATCH = /^(~{3,})\s*?(\w+)?\s*?\n(.*?)^\1~*\s*?\n/m
34
+ FENCED_CODEBLOCK_MATCH = /^((~){3,})\s*?(\w+)?\s*?\n(.*?)^\1\2*\s*?\n/m
35
35
 
36
36
  # Parse the fenced codeblock at the current location.
37
37
  def parse_codeblock_fenced
38
- if @src.check(FENCED_CODEBLOCK_MATCH)
38
+ if @src.check(self.class::FENCED_CODEBLOCK_MATCH)
39
39
  @src.pos += @src.matched_size
40
- el = new_block_el(:codeblock, @src[3])
41
- lang = @src[2].to_s.strip
40
+ el = new_block_el(:codeblock, @src[4])
41
+ lang = @src[3].to_s.strip
42
42
  el.attr['class'] = "language-#{lang}" unless lang.empty?
43
43
  @tree.children << el
44
44
  true
@@ -129,7 +129,7 @@ module Kramdown
129
129
  ALD_ID_NAME = /\w#{ALD_ID_CHARS}*/
130
130
  ALD_TYPE_KEY_VALUE_PAIR = /(#{ALD_ID_NAME})=("|')((?:\\\}|\\\2|[^\}\2])*?)\2/
131
131
  ALD_TYPE_CLASS_NAME = /\.(#{ALD_ID_NAME})/
132
- ALD_TYPE_ID_NAME = /#(\w[\w:-]*)/
132
+ ALD_TYPE_ID_NAME = /#([A-Za-z][\w:-]*)/
133
133
  ALD_TYPE_ID_OR_CLASS = /#{ALD_TYPE_ID_NAME}|#{ALD_TYPE_CLASS_NAME}/
134
134
  ALD_TYPE_ID_OR_CLASS_MULTI = /((?:#{ALD_TYPE_ID_NAME}|#{ALD_TYPE_CLASS_NAME})+)/
135
135
  ALD_TYPE_REF = /(#{ALD_ID_NAME})/
@@ -13,7 +13,7 @@ module Kramdown
13
13
  module Parser
14
14
  class Kramdown
15
15
 
16
- HEADER_ID=/(?:[ \t]+\{#(\w[\w-]*)\})?/
16
+ HEADER_ID=/(?:[ \t]+\{#([A-Za-z][\w:-]*)\})?/
17
17
  SETEXT_HEADER_START = /^(#{OPT_SPACE}[^ \t].*?)#{HEADER_ID}[ \t]*?\n(-|=)+\s*?\n/
18
18
 
19
19
  # Parse the Setext header at the current location.
@@ -15,20 +15,25 @@ module Kramdown
15
15
  # Provides the ability to tranliterate Unicode strings into plain ASCII ones.
16
16
  module Unidecoder
17
17
 
18
- if RUBY_VERSION <= '1.8.6'
18
+ gem 'stringex' if defined?(Gem)
19
+ path = $:.find {|dir| File.directory?(File.join(File.expand_path(dir), "stringex", "unidecoder_data"))}
20
+
21
+ if RUBY_VERSION <= '1.8.6' || !path
19
22
  def self.decode(string)
20
23
  string
21
24
  end
22
25
  else
23
26
 
24
- require 'stringex/unidecoder' # dummy require so that we can get at the data files
27
+ CODEPOINTS = Hash.new do |h, k|
28
+ h[k] = YAML.load_file(File.join(path, "stringex", "unidecoder_data", "#{k}.yml"))
29
+ end
25
30
 
26
31
  # Transliterate string from Unicode into ASCII.
27
32
  def self.decode(string)
28
33
  string.gsub(/[^\x00-\x7f]/u) do |codepoint|
29
34
  begin
30
35
  unpacked = codepoint.unpack("U")[0]
31
- Stringex::Unidecoder::CODEPOINTS["x%02x" % (unpacked >> 8)][unpacked & 255]
36
+ CODEPOINTS["x%02x" % (unpacked >> 8)][unpacked & 255]
32
37
  rescue
33
38
  "?"
34
39
  end
@@ -10,6 +10,6 @@
10
10
  module Kramdown
11
11
 
12
12
  # The kramdown version.
13
- VERSION = '1.1.0'
13
+ VERSION = '1.2.0'
14
14
 
15
15
  end
data/test/test_files.rb CHANGED
@@ -171,6 +171,80 @@ class TestFiles < Test::Unit::TestCase
171
171
  end
172
172
  end
173
173
 
174
+ EXCLUDE_GFM_FILES = [
175
+ 'test/testcases/block/03_paragraph/no_newline_at_end.text',
176
+ 'test/testcases/block/03_paragraph/indented.text',
177
+ 'test/testcases/block/03_paragraph/two_para.text',
178
+ 'test/testcases/block/04_header/atx_header.text',
179
+ 'test/testcases/block/04_header/setext_header.text',
180
+ 'test/testcases/block/05_blockquote/indented.text',
181
+ 'test/testcases/block/05_blockquote/lazy.text',
182
+ 'test/testcases/block/05_blockquote/nested.text',
183
+ 'test/testcases/block/05_blockquote/no_newline_at_end.text',
184
+ 'test/testcases/block/06_codeblock/error.text',
185
+ 'test/testcases/block/07_horizontal_rule/error.text',
186
+ 'test/testcases/block/08_list/escaping.text',
187
+ 'test/testcases/block/08_list/item_ial.text',
188
+ 'test/testcases/block/08_list/lazy.text',
189
+ 'test/testcases/block/08_list/list_and_others.text',
190
+ 'test/testcases/block/08_list/other_first_element.text',
191
+ 'test/testcases/block/08_list/simple_ul.text',
192
+ 'test/testcases/block/08_list/special_cases.text',
193
+ 'test/testcases/block/09_html/comment.text',
194
+ 'test/testcases/block/09_html/html_to_native/code.text',
195
+ 'test/testcases/block/09_html/html_to_native/emphasis.text',
196
+ 'test/testcases/block/09_html/html_to_native/typography.text',
197
+ 'test/testcases/block/09_html/parse_as_raw.text',
198
+ 'test/testcases/block/09_html/simple.text',
199
+ 'test/testcases/block/12_extension/comment.text',
200
+ 'test/testcases/block/12_extension/ignored.text',
201
+ 'test/testcases/block/12_extension/nomarkdown.text',
202
+ 'test/testcases/block/13_definition_list/item_ial.text',
203
+ 'test/testcases/block/13_definition_list/multiple_terms.text',
204
+ 'test/testcases/block/13_definition_list/no_def_list.text',
205
+ 'test/testcases/block/13_definition_list/simple.text',
206
+ 'test/testcases/block/13_definition_list/with_blocks.text',
207
+ 'test/testcases/block/14_table/errors.text',
208
+ 'test/testcases/block/14_table/escaping.text',
209
+ 'test/testcases/block/14_table/simple.text',
210
+ 'test/testcases/block/15_math/normal.text',
211
+ 'test/testcases/encoding.text',
212
+ 'test/testcases/span/01_link/inline.text',
213
+ 'test/testcases/span/01_link/link_defs.text',
214
+ 'test/testcases/span/01_link/reference.text',
215
+ 'test/testcases/span/02_emphasis/normal.text',
216
+ 'test/testcases/span/03_codespan/normal.text',
217
+ 'test/testcases/span/04_footnote/definitions.text',
218
+ 'test/testcases/span/04_footnote/markers.text',
219
+ 'test/testcases/span/05_html/across_lines.text',
220
+ 'test/testcases/span/05_html/markdown_attr.text',
221
+ 'test/testcases/span/05_html/normal.text',
222
+ 'test/testcases/span/autolinks/url_links.text',
223
+ 'test/testcases/span/extension/comment.text',
224
+ 'test/testcases/span/ial/simple.text',
225
+ 'test/testcases/span/line_breaks/normal.text',
226
+ 'test/testcases/span/text_substitutions/entities_as_char.text',
227
+ 'test/testcases/span/text_substitutions/entities.text',
228
+ 'test/testcases/span/text_substitutions/typography.text'
229
+ ]
230
+
231
+ # Generate test methods for gfm-to-html conversion
232
+ Dir[File.dirname(__FILE__) + '/{testcases,testcases_gfm}/**/*.text'].each do |text_file|
233
+ next if EXCLUDE_GFM_FILES.any? {|f| text_file =~ /#{f}$/}
234
+ basename = text_file.sub(/\.text$/, '')
235
+
236
+ html_file = [(".html.19" if RUBY_VERSION >= '1.9'), ".html"].compact.
237
+ map {|ext| basename + ext }.
238
+ detect {|file| File.exist?(file) }
239
+
240
+ define_method('test_gfm_' + text_file.tr('.', '_') + "_to_html") do
241
+ opts_file = basename + '.options'
242
+ opts_file = File.join(File.dirname(html_file), 'options') if !File.exist?(opts_file)
243
+ options = File.exist?(opts_file) ? YAML::load(File.read(opts_file)) : {:auto_ids => false, :footnote_nr => 1}
244
+ doc = Kramdown::Document.new(File.read(text_file), options.merge(:input => 'GFM'))
245
+ assert_equal(File.read(html_file), doc.to_html)
246
+ end
247
+ end
174
248
 
175
249
 
176
250
  # Generate test methods for asserting that converters don't modify the document tree.
@@ -0,0 +1,18 @@
1
+ <p>This is a para.</p>
2
+
3
+ <p>This is a para.</p>
4
+
5
+ <p>This is a para.</p>
6
+
7
+ <p>This is a para.</p>
8
+
9
+ <pre><code>This is a code block.
10
+ </code></pre>
11
+
12
+ <p>And this is another.</p>
13
+
14
+ <p>A para
15
+ <br /> with
16
+ <br /> mixed
17
+ <br />indents.
18
+ <br /> and with much indent</p>
@@ -34,10 +34,14 @@
34
34
 
35
35
  <h3 id="id">Header</h3>
36
36
 
37
- <h3 id="id">Header</h3>
37
+ <h3 id="Id">Header</h3>
38
38
 
39
39
  <h3 id="id">Header</h3>
40
40
 
41
+ <h3 id="A-Za-z0-9_:t">Header</h3>
42
+
43
+ <h3>Header {#9ab}</h3>
44
+
41
45
  <h3>Header{#noid}</h3>
42
46
 
43
47
  <h3>Header ##{#noid}</h3>
@@ -32,10 +32,14 @@ paragraph
32
32
 
33
33
  ### Header {#id}
34
34
 
35
- ### Header ## {#id}
35
+ ### Header ## {#Id}
36
36
 
37
37
  ### Header ## {#id}
38
38
 
39
+ ### Header {#A-Za-z0-9_:t}
40
+
41
+ ### Header {#9ab}
42
+
39
43
  ### Header{#noid}
40
44
 
41
45
  ### Header ##{#noid}
@@ -23,7 +23,9 @@ Not a Header
23
23
 
24
24
  <h2 id="id">header</h2>
25
25
 
26
- <h1 id="id">header</h1>
26
+ <h1 id="Id">header</h1>
27
+
28
+ <h2 id="A-Za-z0-9_:">header</h2>
27
29
 
28
30
  <h2>header{#noid}</h2>
29
31
 
@@ -26,9 +26,12 @@ Not a Header
26
26
  header {#id}
27
27
  ------------
28
28
 
29
- header {#id}
29
+ header {#Id}
30
30
  ======
31
31
 
32
+ header {#A-Za-z0-9_:}
33
+ ------
34
+
32
35
  header{#noid}
33
36
  -----
34
37
 
@@ -15,3 +15,5 @@
15
15
 
16
16
  <pre><code>- - -
17
17
  </code></pre>
18
+
19
+ <hr class="test" />
@@ -15,3 +15,6 @@ text
15
15
  * * *
16
16
 
17
17
  - - -
18
+
19
+ * * *
20
+ {:.test}
@@ -0,0 +1,2 @@
1
+ <pre><code class="language-ruby">Kramdown::Document.new(text, :input =&gt; 'GFM')
2
+ </code></pre>
@@ -0,0 +1 @@
1
+ :enable_coderay: false
@@ -0,0 +1,3 @@
1
+ ```ruby
2
+ Kramdown::Document.new(text, :input => 'GFM')
3
+ ```
@@ -0,0 +1,20 @@
1
+ <pre><code>Three backticks
2
+ </code></pre>
3
+
4
+ <pre><code>Four backticks
5
+ </code></pre>
6
+
7
+ <pre><code>Unbalanced bottom heavy
8
+ </code></pre>
9
+
10
+ <div><div class="CodeRay">
11
+ <div class="code"><pre><span class="line-numbers"><a href="#n1" name="n1">1</a></span>language no space
12
+ </pre></div>
13
+ </div>
14
+ </div>
15
+
16
+ <div><div class="CodeRay">
17
+ <div class="code"><pre><span class="line-numbers"><a href="#n1" name="n1">1</a></span>language with space
18
+ </pre></div>
19
+ </div>
20
+ </div>
@@ -0,0 +1,19 @@
1
+ ```
2
+ Three backticks
3
+ ```
4
+
5
+ ````
6
+ Four backticks
7
+ ````
8
+
9
+ ```
10
+ Unbalanced bottom heavy
11
+ ``````
12
+
13
+ ````ruby
14
+ language no space
15
+ ````
16
+
17
+ ```` ruby
18
+ language with space
19
+ ````
@@ -0,0 +1,4 @@
1
+ <p>This is just a normal paragraph.<br />
2
+ Containing a line break.</p>
3
+
4
+ <p>Another paragraph.</p>
@@ -0,0 +1,4 @@
1
+ This is just a normal paragraph.
2
+ Containing a line break.
3
+
4
+ Another paragraph.
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.1.0
4
+ version: 1.2.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: 2013-07-02 00:00:00.000000000 Z
11
+ date: 2013-08-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: coderay
@@ -38,11 +38,9 @@ dependencies:
38
38
  - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: 1.5.1
41
- description: ! 'kramdown is yet-another-markdown-parser but fast, pure Ruby,
42
-
41
+ description: |
42
+ kramdown is yet-another-markdown-parser but fast, pure Ruby,
43
43
  using a strict syntax definition and supporting several common extensions.
44
-
45
- '
46
44
  email: t_leitner@gmx.at
47
45
  executables:
48
46
  - kramdown
@@ -79,6 +77,7 @@ files:
79
77
  - lib/kramdown/options.rb
80
78
  - lib/kramdown/parser.rb
81
79
  - lib/kramdown/parser/base.rb
80
+ - lib/kramdown/parser/gfm.rb
82
81
  - lib/kramdown/parser/html.rb
83
82
  - lib/kramdown/parser/kramdown.rb
84
83
  - lib/kramdown/parser/kramdown/abbreviation.rb
@@ -146,6 +145,7 @@ files:
146
145
  - test/testcases/block/02_eob/middle.html
147
146
  - test/testcases/block/02_eob/middle.text
148
147
  - test/testcases/block/03_paragraph/indented.html
148
+ - test/testcases/block/03_paragraph/indented.html.gfm
149
149
  - test/testcases/block/03_paragraph/indented.text
150
150
  - test/testcases/block/03_paragraph/no_newline_at_end.html
151
151
  - test/testcases/block/03_paragraph/no_newline_at_end.text
@@ -490,6 +490,13 @@ files:
490
490
  - test/testcases/span/text_substitutions/typography.html
491
491
  - test/testcases/span/text_substitutions/typography.options
492
492
  - test/testcases/span/text_substitutions/typography.text
493
+ - test/testcases_gfm/backticks_disable_highlighting.html
494
+ - test/testcases_gfm/backticks_disable_highlighting.options
495
+ - test/testcases_gfm/backticks_disable_highlighting.text
496
+ - test/testcases_gfm/backticks_syntax.html
497
+ - test/testcases_gfm/backticks_syntax.text
498
+ - test/testcases_gfm/two_para_hard_line_breaks.html
499
+ - test/testcases_gfm/two_para_hard_line_breaks.text
493
500
  homepage: http://kramdown.rubyforge.org
494
501
  licenses:
495
502
  - MIT
@@ -502,17 +509,17 @@ require_paths:
502
509
  - lib
503
510
  required_ruby_version: !ruby/object:Gem::Requirement
504
511
  requirements:
505
- - - ! '>='
512
+ - - '>='
506
513
  - !ruby/object:Gem::Version
507
514
  version: '0'
508
515
  required_rubygems_version: !ruby/object:Gem::Requirement
509
516
  requirements:
510
- - - ! '>='
517
+ - - '>='
511
518
  - !ruby/object:Gem::Version
512
519
  version: '0'
513
520
  requirements: []
514
521
  rubyforge_project: kramdown
515
- rubygems_version: 2.0.0
522
+ rubygems_version: 2.0.3
516
523
  signing_key:
517
524
  specification_version: 4
518
525
  summary: kramdown is a fast, pure-Ruby Markdown-superset converter.