[DRE-commits] [ruby-kramdown] 01/07: Imported Upstream version 1.9.0

Youhei SASAKI uwabami-guest at moszumanska.debian.org
Wed Mar 16 13:24:34 UTC 2016


This is an automated email from the git hooks/post-receive script.

uwabami-guest pushed a commit to branch master
in repository ruby-kramdown.

commit f78e90710282fb17502cce8486c47d4cca2230fe
Author: Youhei SASAKI <uwabami at gfd-dennou.org>
Date:   Sun Nov 22 15:53:46 2015 +0900

    Imported Upstream version 1.9.0
---
 CONTRIBUTERS                                       |  4 ++-
 README.md                                          |  3 ++
 Rakefile                                           |  2 +-
 VERSION                                            |  2 +-
 benchmark/testing.sh                               |  2 +-
 doc/index.page                                     |  4 +--
 lib/kramdown/converter.rb                          |  1 +
 lib/kramdown/converter/hash_ast.rb                 | 36 ++++++++++++++++++++++
 lib/kramdown/converter/html.rb                     |  8 +++--
 lib/kramdown/converter/syntax_highlighter/rouge.rb | 29 ++++++++++++++---
 lib/kramdown/options.rb                            |  3 ++
 lib/kramdown/parser/gfm.rb                         |  6 ++--
 lib/kramdown/utils/ordered_hash.rb                 |  5 +++
 lib/kramdown/version.rb                            |  2 +-
 man/man1/kramdown.1                                |  3 ++
 metadata.yml                                       | 26 +++++++++++-----
 test/test_files.rb                                 | 27 +++++++++-------
 test/test_location.rb                              | 10 ++++++
 .../block/06_codeblock/rouge/disabled.html         |  2 ++
 .../disabled.options}                              |  3 +-
 .../block/06_codeblock/rouge/disabled.text         |  1 +
 .../{highlighting-rouge.html => rouge/simple.html} |  0
 .../simple.options}                                |  0
 .../{highlighting-rouge.text => rouge/simple.text} |  0
 .../testcases/span/03_codespan/rouge/disabled.html |  1 +
 .../03_codespan/rouge/disabled.options}            |  3 +-
 .../testcases/span/03_codespan/rouge/disabled.text |  1 +
 .../{highlighting-rouge.html => rouge/simple.html} |  0
 .../simple.options}                                |  0
 .../{highlighting-rouge.text => rouge/simple.text} |  0
 .../span/04_footnote/without_backlink.html         |  9 ++++++
 .../span/04_footnote/without_backlink.options      |  1 +
 .../span/04_footnote/without_backlink.text         |  3 ++
 33 files changed, 160 insertions(+), 37 deletions(-)

diff --git a/CONTRIBUTERS b/CONTRIBUTERS
index 2d3c7b0..b017783 100644
--- a/CONTRIBUTERS
+++ b/CONTRIBUTERS
@@ -1,6 +1,6 @@
   Count Name
 ======= ====
-    772 Thomas Leitner <t_leitner at gmx.at>
+    781 Thomas Leitner <t_leitner at gmx.at>
       6 Gioele Barabucci <gioele at svario.it>
       4 Ted Pak <powerpak006 at gmail.com>
       4 Arne Brasseur <arne at arnebrasseur.net>
@@ -29,12 +29,14 @@
       1 myqlarson <myqlarson at gmail.com>
       1 Michal Till <michal.till at gmail.com>
       1 Matt Hickford <matt.hickford at gmail.com>
+      1 Marek Tuchowski <marek at tuchowski.com.pl>
       1 Marcus Stollsteimer <sto.mar at web.de>
       1 Luca Barbato <luca.barbato at gmail.com>
       1 l3kn <hello at l3kn.de>
       1 John Croisant <jacius at gmail.com>
       1 Joe Fiorini <joe at faithfulgeek.org>
       1 Jens Kraemer <jk at jkraemer.net>
+      1 Hector Correa <hector at hectorcorrea.com>
       1 Floreal Morandat florealm at gmail.com <florealm at gmail.com>
       1 Damien Pollet <damien.pollet at gmail.com>
       1 Alex Tomlins <alex.tomlins at digital.cabinet-office.gov.uk>
diff --git a/README.md b/README.md
index e7baa7b..8c7f9ad 100644
--- a/README.md
+++ b/README.md
@@ -34,6 +34,9 @@ Starting from version 1.0.0 kramdown is using a versioning scheme with major, mi
 in the version number where the major number changes on backwards-incompatible changes, the minor
 number on the introduction of new features and the patch number on everything else.
 
+For information about changes between versions, have a look at
+<http://kramdown.gettalong.org/news.html> or the commit history!
+
 
 ## Usage
 
diff --git a/Rakefile b/Rakefile
index e45543b..b4c17d6 100644
--- a/Rakefile
+++ b/Rakefile
@@ -75,7 +75,7 @@ end
 if defined?(Webgen)
   desc "Generate the HTML documentation"
   task :htmldoc do
-    ruby "-Ilib -S webgen"
+    ruby "-S webgen"
   end
   CLOBBER << "htmldoc/"
   CLOBBER << "webgen-tmp"
diff --git a/VERSION b/VERSION
index 27f9cd3..f8e233b 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.8.0
+1.9.0
diff --git a/benchmark/testing.sh b/benchmark/testing.sh
index eb08fe7..683afc8 100755
--- a/benchmark/testing.sh
+++ b/benchmark/testing.sh
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-source ~/.bashrc
+source ~/.profile
 
 COMMAND="$@"
 if [[ -z "$COMMAND" ]]; then COMMAND="rake test"; fi
diff --git a/doc/index.page b/doc/index.page
index 1d612a9..a9a1d6b 100644
--- a/doc/index.page
+++ b/doc/index.page
@@ -97,8 +97,8 @@ extensions that have been made popular by the [PHP Markdown Extra] package and [
 It is probably the fastest pure-Ruby Markdown converter available (September 2014), being about 3x
 faster than [Maruku] and about 4.5x faster than [BlueFeather].
 
-Version **1.8.0**{:itemprop="softwareVersion"} released on
-**2015-07-04**{:itemprop="datePublished"}, [more news](news.html)
+Version **1.9.0**{:itemprop="softwareVersion"} released on
+**2015-10-01**{:itemprop="datePublished"}, [more news](news.html)
 {: style="text-align: center; font-size: 80%"}
 
 </div>
diff --git a/lib/kramdown/converter.rb b/lib/kramdown/converter.rb
index 76fcff3..7221634 100644
--- a/lib/kramdown/converter.rb
+++ b/lib/kramdown/converter.rb
@@ -26,6 +26,7 @@ module Kramdown
     autoload :Toc, 'kramdown/converter/toc'
     autoload :RemoveHtmlTags, 'kramdown/converter/remove_html_tags'
     autoload :Pdf, 'kramdown/converter/pdf'
+    autoload :HashAST, 'kramdown/converter/hash_ast'
 
     extend ::Kramdown::Utils::Configurable
 
diff --git a/lib/kramdown/converter/hash_ast.rb b/lib/kramdown/converter/hash_ast.rb
new file mode 100644
index 0000000..dff030a
--- /dev/null
+++ b/lib/kramdown/converter/hash_ast.rb
@@ -0,0 +1,36 @@
+# -*- coding: utf-8 -*-
+#
+#--
+# Copyright (C) 2009-2015 Thomas Leitner <t_leitner at gmx.at>
+#
+# This file is part of kramdown which is licensed under the MIT.
+#++
+#
+
+require 'kramdown/parser'
+require 'kramdown/converter'
+require 'kramdown/utils'
+
+module Kramdown
+
+  module Converter
+
+    # Converts a Kramdown::Document to a nested hash for further processing or debug output.
+    class HashAST < Base
+
+      def convert(el)
+        hash = {:type => el.type}
+        hash[:attr] = el.attr unless el.attr.empty?
+        hash[:value] = el.value unless el.value.nil?
+        hash[:options] = el.options unless el.options.empty?
+        unless el.children.empty?
+          hash[:children] = []
+          el.children.each {|child| hash[:children] << convert(child)}
+        end
+        hash
+      end
+
+    end
+
+  end
+end
diff --git a/lib/kramdown/converter/html.rb b/lib/kramdown/converter/html.rb
index 2109628..1d99a9f 100644
--- a/lib/kramdown/converter/html.rb
+++ b/lib/kramdown/converter/html.rb
@@ -444,9 +444,11 @@ module Kramdown
             insert_space = false
           end
 
-          para.children << Element.new(:raw, FOOTNOTE_BACKLINK_FMT % [insert_space ? ' ' : '', name, backlink_text])
-          (1..repeat).each do |index|
-            para.children << Element.new(:raw, FOOTNOTE_BACKLINK_FMT % [" ", "#{name}:#{index}", "#{backlink_text}<sup>#{index+1}</sup>"])
+          unless @options[:footnote_backlink].empty?
+            para.children << Element.new(:raw, FOOTNOTE_BACKLINK_FMT % [insert_space ? ' ' : '', name, backlink_text])
+            (1..repeat).each do |index|
+              para.children << Element.new(:raw, FOOTNOTE_BACKLINK_FMT % [" ", "#{name}:#{index}", "#{backlink_text}<sup>#{index+1}</sup>"])
+            end
           end
 
           ol.children << Element.new(:raw, convert(li, 4))
diff --git a/lib/kramdown/converter/syntax_highlighter/rouge.rb b/lib/kramdown/converter/syntax_highlighter/rouge.rb
index ae1cdf9..497d3c4 100644
--- a/lib/kramdown/converter/syntax_highlighter/rouge.rb
+++ b/lib/kramdown/converter/syntax_highlighter/rouge.rb
@@ -22,16 +22,37 @@ module Kramdown::Converter::SyntaxHighlighter
     end
 
     def self.call(converter, text, lang, type, _unused_opts)
-      opts = converter.options[:syntax_highlighter_opts].dup
+      opts = options(converter, type)
       lexer = ::Rouge::Lexer.find_fancy(lang || opts[:default_lang], text)
-      return nil unless lexer
-
-      opts[:wrap] = false if type == :span
+      return nil if opts[:disable] || !lexer
 
       formatter = (opts.delete(:formatter) || ::Rouge::Formatters::HTML).new(opts)
       formatter.format(lexer.lex(text))
     end
 
+    def self.options(converter, type)
+      prepare_options(converter)
+      converter.data[:syntax_highlighter_rouge][type]
+    end
+
+    def self.prepare_options(converter)
+      return if converter.data.key?(:syntax_highlighter_rouge)
+
+      cache = converter.data[:syntax_highlighter_rouge] = {}
+
+      opts = converter.options[:syntax_highlighter_opts].dup
+      span_opts = (opts.delete(:span) || {}).dup
+      block_opts = (opts.delete(:block) || {}).dup
+      [span_opts, block_opts].each do |hash|
+        hash.keys.each do |k|
+          hash[k.kind_of?(String) ? Kramdown::Options.str_to_sym(k) : k] = hash.delete(k)
+        end
+      end
+
+      cache[:span] = opts.merge(span_opts).update(:wrap => false)
+      cache[:block] = opts.merge(block_opts)
+    end
+
   end
 
 end
diff --git a/lib/kramdown/options.rb b/lib/kramdown/options.rb
index cc560a2..55eb799 100644
--- a/lib/kramdown/options.rb
+++ b/lib/kramdown/options.rb
@@ -586,6 +586,9 @@ Defines the text that should be used for the footnote backlinks
 The footnote backlink is just text, so any special HTML characters will
 be escaped.
 
+If the footnote backlint text is an empty string, no footnote backlinks
+will be generated.
+
 Default: '&8617;'
 Used by: HTML converter
 EOF
diff --git a/lib/kramdown/parser/gfm.rb b/lib/kramdown/parser/gfm.rb
index 029d2bd..21efde3 100644
--- a/lib/kramdown/parser/gfm.rb
+++ b/lib/kramdown/parser/gfm.rb
@@ -38,8 +38,10 @@ module Kramdown
             omit_trailing_br = (Kramdown::Element.category(element) == :block && element.children[-1] == child &&
                                 lines[-1].empty?)
             lines.each_with_index do |line, index|
-              children << Element.new(:text, (index > 0 ? "\n#{line}" : line))
-              children << Element.new(:br) if index < lines.size - 2 ||
+              new_element_options = { :location => child.options[:location] + index }
+
+              children << Element.new(:text, (index > 0 ? "\n#{line}" : line), nil, new_element_options)
+              children << Element.new(:br, nil, nil, new_element_options) if index < lines.size - 2 ||
                 (index == lines.size - 2 && !omit_trailing_br)
             end
             children
diff --git a/lib/kramdown/utils/ordered_hash.rb b/lib/kramdown/utils/ordered_hash.rb
index f5bbfcd..df5cbff 100644
--- a/lib/kramdown/utils/ordered_hash.rb
+++ b/lib/kramdown/utils/ordered_hash.rb
@@ -43,6 +43,11 @@ module Kramdown
           @data.has_key?(key)
         end
 
+        # Return +true+ if the hash contains no keys.
+        def empty?
+          @data.empty?
+        end
+
         # Set the value for the +key+ to +val+.
         def []=(key, val)
           @order << key if !@data.has_key?(key)
diff --git a/lib/kramdown/version.rb b/lib/kramdown/version.rb
index bbcfefd..0ae8ece 100644
--- a/lib/kramdown/version.rb
+++ b/lib/kramdown/version.rb
@@ -10,6 +10,6 @@
 module Kramdown
 
   # The kramdown version.
-  VERSION = '1.8.0'
+  VERSION = '1.9.0'
 
 end
diff --git a/man/man1/kramdown.1 b/man/man1/kramdown.1
index 2eb1e18..28eba7f 100644
--- a/man/man1/kramdown.1
+++ b/man/man1/kramdown.1
@@ -189,6 +189,9 @@ Defines the text that should be used for the footnote backlinks
 The footnote backlink is just text, so any special HTML characters will
 be escaped.
 
+If the footnote backlint text is an empty string, no footnote backlinks
+will be generated.
+
 Default: '&8617;'
 Used by: HTML converter
 
diff --git a/metadata.yml b/metadata.yml
index 86404d8..b875463 100644
--- a/metadata.yml
+++ b/metadata.yml
@@ -1,14 +1,14 @@
 --- !ruby/object:Gem::Specification
 name: kramdown
 version: !ruby/object:Gem::Version
-  version: 1.8.0
+  version: 1.9.0
 platform: ruby
 authors:
 - Thomas Leitner
 autorequire: 
 bindir: bin
 cert_chain: []
-date: 2015-07-04 00:00:00.000000000 Z
+date: 2015-10-01 00:00:00.000000000 Z
 dependencies:
 - !ruby/object:Gem::Dependency
   name: minitest
@@ -156,6 +156,7 @@ files:
 - lib/kramdown/compatibility.rb
 - lib/kramdown/converter.rb
 - lib/kramdown/converter/base.rb
+- lib/kramdown/converter/hash_ast.rb
 - lib/kramdown/converter/html.rb
 - lib/kramdown/converter/kramdown.rb
 - lib/kramdown/converter/latex.rb
@@ -285,9 +286,6 @@ files:
 - test/testcases/block/06_codeblock/highlighting-opts.html
 - test/testcases/block/06_codeblock/highlighting-opts.options
 - test/testcases/block/06_codeblock/highlighting-opts.text
-- test/testcases/block/06_codeblock/highlighting-rouge.html
-- test/testcases/block/06_codeblock/highlighting-rouge.options
-- test/testcases/block/06_codeblock/highlighting-rouge.text
 - test/testcases/block/06_codeblock/highlighting.html
 - test/testcases/block/06_codeblock/highlighting.options
 - test/testcases/block/06_codeblock/highlighting.text
@@ -301,6 +299,12 @@ files:
 - test/testcases/block/06_codeblock/no_newline_at_end_1.text
 - test/testcases/block/06_codeblock/normal.html
 - test/testcases/block/06_codeblock/normal.text
+- test/testcases/block/06_codeblock/rouge/disabled.html
+- test/testcases/block/06_codeblock/rouge/disabled.options
+- test/testcases/block/06_codeblock/rouge/disabled.text
+- test/testcases/block/06_codeblock/rouge/simple.html
+- test/testcases/block/06_codeblock/rouge/simple.options
+- test/testcases/block/06_codeblock/rouge/simple.text
 - test/testcases/block/06_codeblock/tilde_syntax.html
 - test/testcases/block/06_codeblock/tilde_syntax.text
 - test/testcases/block/06_codeblock/whitespace.html
@@ -556,13 +560,16 @@ files:
 - test/testcases/span/03_codespan/highlighting-minted.latex
 - test/testcases/span/03_codespan/highlighting-minted.options
 - test/testcases/span/03_codespan/highlighting-minted.text
-- test/testcases/span/03_codespan/highlighting-rouge.html
-- test/testcases/span/03_codespan/highlighting-rouge.options
-- test/testcases/span/03_codespan/highlighting-rouge.text
 - test/testcases/span/03_codespan/highlighting.html
 - test/testcases/span/03_codespan/highlighting.text
 - test/testcases/span/03_codespan/normal.html
 - test/testcases/span/03_codespan/normal.text
+- test/testcases/span/03_codespan/rouge/disabled.html
+- test/testcases/span/03_codespan/rouge/disabled.options
+- test/testcases/span/03_codespan/rouge/disabled.text
+- test/testcases/span/03_codespan/rouge/simple.html
+- test/testcases/span/03_codespan/rouge/simple.options
+- test/testcases/span/03_codespan/rouge/simple.text
 - test/testcases/span/04_footnote/backlink_text.html
 - test/testcases/span/04_footnote/backlink_text.options
 - test/testcases/span/04_footnote/backlink_text.text
@@ -582,6 +589,9 @@ files:
 - test/testcases/span/04_footnote/placement.text
 - test/testcases/span/04_footnote/regexp_problem.html
 - test/testcases/span/04_footnote/regexp_problem.text
+- test/testcases/span/04_footnote/without_backlink.html
+- test/testcases/span/04_footnote/without_backlink.options
+- test/testcases/span/04_footnote/without_backlink.text
 - test/testcases/span/05_html/across_lines.html
 - test/testcases/span/05_html/across_lines.text
 - test/testcases/span/05_html/button.html
diff --git a/test/test_files.rb b/test/test_files.rb
index 4e95ba3..5c0525f 100644
--- a/test/test_files.rb
+++ b/test/test_files.rb
@@ -17,14 +17,14 @@ Encoding.default_external = 'utf-8' if RUBY_VERSION >= '1.9'
 class TestFiles < Minitest::Test
 
   EXCLUDE_KD_FILES = [('test/testcases/block/04_header/with_auto_ids.text' if RUBY_VERSION <= '1.8.6'), # bc of dep stringex not working
-                      ('test/testcases/span/03_codespan/highlighting-rouge.text' if RUBY_VERSION < '2.0'), #bc of rouge
-                      ('test/testcases/block/06_codeblock/highlighting-rouge.text' if RUBY_VERSION < '2.0'), #bc of rouge
+                      ('test/testcases/span/03_codespan/rouge/' if RUBY_VERSION < '2.0'), #bc of rouge
+                      ('test/testcases/block/06_codeblock/rouge/' if RUBY_VERSION < '2.0'), #bc of rouge
 
                      ].compact
 
   # Generate test methods for kramdown-to-xxx conversion
   Dir[File.dirname(__FILE__) + '/testcases/**/*.text'].each do |text_file|
-    next if EXCLUDE_KD_FILES.any? {|f| text_file =~ /#{f}$/}
+    next if EXCLUDE_KD_FILES.any? {|f| text_file =~ /#{f}/}
     basename = text_file.sub(/\.text$/, '')
     opts_file = text_file.sub(/\.text$/, '.options')
     (Dir[basename + ".*"] - [text_file, opts_file]).each do |output_file|
@@ -51,8 +51,9 @@ class TestFiles < Minitest::Test
                           'test/testcases/span/03_codespan/highlighting.html', # bc of span elements inside code element
                           'test/testcases/block/04_header/with_auto_ids.html', # bc of auto_ids=true option
                           'test/testcases/block/04_header/header_type_offset.html', # bc of header_offset option
-                          'test/testcases/block/06_codeblock/highlighting-rouge.html', # bc of double surrounding <div>
-                          ('test/testcases/span/03_codespan/highlighting-rouge.html' if RUBY_VERSION < '2.0'),
+                          'test/testcases/block/06_codeblock/rouge/simple.html', # bc of double surrounding <div>
+                          ('test/testcases/span/03_codespan/rouge/simple.html' if RUBY_VERSION < '2.0'),
+                          ('test/testcases/span/03_codespan/rouge/disabled.html' if RUBY_VERSION < '2.0'),
                           'test/testcases/block/15_math/ritex.html', # bc of tidy
                           'test/testcases/span/math/ritex.html', # bc of tidy
                           'test/testcases/block/15_math/itex2mml.html', # bc of tidy
@@ -153,8 +154,9 @@ class TestFiles < Minitest::Test
                           'test/testcases/span/extension/comment.text',      # bc of comment text modifications (can this be avoided?)
                           'test/testcases/block/04_header/header_type_offset.text', # bc of header_offset being applied twice
                           ('test/testcases/block/04_header/with_auto_ids.text' if RUBY_VERSION <= '1.8.6'), # bc of dep stringex not working
-                          ('test/testcases/span/03_codespan/highlighting-rouge.text' if RUBY_VERSION < '2.0'),
-                          ('test/testcases/block/06_codeblock/highlighting-rouge.text' if RUBY_VERSION < '2.0'), #bc of rouge
+                          ('test/testcases/span/03_codespan/rouge/simple.text' if RUBY_VERSION < '2.0'), #bc of rouge
+                          ('test/testcases/span/03_codespan/rouge/disabled.text' if RUBY_VERSION < '2.0'), #bc of rouge
+                          ('test/testcases/block/06_codeblock/rouge/simple.text' if RUBY_VERSION < '2.0'), #bc of rouge
                           'test/testcases/block/15_math/ritex.text', # bc of tidy
                           'test/testcases/span/math/ritex.text', # bc of tidy
                           'test/testcases/block/15_math/itex2mml.text', # bc of tidy
@@ -193,14 +195,15 @@ class TestFiles < Minitest::Test
                              'test/testcases/block/09_html/markdown_attr.html',   # bc of markdown attr
                              'test/testcases/block/09_html/html_to_native/table_simple.html', # bc of invalidly converted simple table
                              'test/testcases/block/06_codeblock/whitespace.html', # bc of entity to char conversion
-                             'test/testcases/block/06_codeblock/highlighting-rouge.html', # bc of double surrounding <div>
+                             'test/testcases/block/06_codeblock/rouge/simple.html', # bc of double surrounding <div>
                              'test/testcases/block/11_ial/simple.html',           # bc of change of ordering of attributes in header
                              'test/testcases/span/03_codespan/highlighting.html', # bc of span elements inside code element
                              'test/testcases/block/04_header/with_auto_ids.html', # bc of auto_ids=true option
                              'test/testcases/block/04_header/header_type_offset.html', # bc of header_offset option
                              'test/testcases/block/16_toc/toc_exclude.html',      # bc of different attribute ordering
                              'test/testcases/span/autolinks/url_links.html',      # bc of quot entity being converted to char
-                             ('test/testcases/span/03_codespan/highlighting-rouge.html' if RUBY_VERSION < '2.0'),
+                             ('test/testcases/span/03_codespan/rouge/simple.html' if RUBY_VERSION < '2.0'),
+                             ('test/testcases/span/03_codespan/rouge/disabled.html' if RUBY_VERSION < '2.0'),
                              'test/testcases/block/15_math/ritex.html', # bc of tidy
                              'test/testcases/span/math/ritex.html', # bc of tidy
                              'test/testcases/block/15_math/itex2mml.html', # bc of tidy
@@ -284,8 +287,10 @@ class TestFiles < Minitest::Test
                        'test/testcases/span/text_substitutions/entities_as_char.text',
                        'test/testcases/span/text_substitutions/entities.text',
                        'test/testcases/span/text_substitutions/typography.text',
-                       ('test/testcases/span/03_codespan/highlighting-rouge.text' if RUBY_VERSION < '2.0'),
-                       ('test/testcases/block/06_codeblock/highlighting-rouge.text' if RUBY_VERSION < '2.0'), #bc of rouge
+                       ('test/testcases/span/03_codespan/rouge/simple.text' if RUBY_VERSION < '2.0'),
+                       ('test/testcases/span/03_codespan/rouge/disabled.text' if RUBY_VERSION < '2.0'),
+                       ('test/testcases/block/06_codeblock/rouge/simple.text' if RUBY_VERSION < '2.0'), #bc of rouge
+                       ('test/testcases/block/06_codeblock/rouge/disabled.text' if RUBY_VERSION < '2.0'), #bc of rouge
                       ].compact
 
   # Generate test methods for gfm-to-html conversion
diff --git a/test/test_location.rb b/test/test_location.rb
index 35c29fc..c35987c 100644
--- a/test/test_location.rb
+++ b/test/test_location.rb
@@ -216,4 +216,14 @@ describe 'location' do
     end
   end
 
+  it 'handles hard wrapped paragraphs with the GFM parser' do
+    str = "A*b*C\nA*b*C\nA*b*C"
+    doc = Kramdown::Document.new(str, :input => 'GFM', :hard_wrap => true)
+    para = doc.root.children.first
+    1.upto(3) do |line|
+      0.upto(line == 3 ? 2 : 3) do |element|
+        assert_equal(line, para.children[4*(line - 1) + element].options[:location])
+      end
+    end
+  end
 end
diff --git a/test/testcases/block/06_codeblock/rouge/disabled.html b/test/testcases/block/06_codeblock/rouge/disabled.html
new file mode 100644
index 0000000..2cc34d3
--- /dev/null
+++ b/test/testcases/block/06_codeblock/rouge/disabled.html
@@ -0,0 +1,2 @@
+<pre><code>x = Class.new
+</code></pre>
diff --git a/test/testcases/block/06_codeblock/highlighting-rouge.options b/test/testcases/block/06_codeblock/rouge/disabled.options
similarity index 66%
copy from test/testcases/block/06_codeblock/highlighting-rouge.options
copy to test/testcases/block/06_codeblock/rouge/disabled.options
index f59e0ff..5688828 100644
--- a/test/testcases/block/06_codeblock/highlighting-rouge.options
+++ b/test/testcases/block/06_codeblock/rouge/disabled.options
@@ -1,3 +1,4 @@
 :syntax_highlighter: rouge
 :syntax_highlighter_opts:
-  default_lang: ruby
+  block:
+    disable: true
diff --git a/test/testcases/block/06_codeblock/rouge/disabled.text b/test/testcases/block/06_codeblock/rouge/disabled.text
new file mode 100644
index 0000000..0e50b41
--- /dev/null
+++ b/test/testcases/block/06_codeblock/rouge/disabled.text
@@ -0,0 +1 @@
+    x = Class.new
diff --git a/test/testcases/block/06_codeblock/highlighting-rouge.html b/test/testcases/block/06_codeblock/rouge/simple.html
similarity index 100%
rename from test/testcases/block/06_codeblock/highlighting-rouge.html
rename to test/testcases/block/06_codeblock/rouge/simple.html
diff --git a/test/testcases/block/06_codeblock/highlighting-rouge.options b/test/testcases/block/06_codeblock/rouge/simple.options
similarity index 100%
copy from test/testcases/block/06_codeblock/highlighting-rouge.options
copy to test/testcases/block/06_codeblock/rouge/simple.options
diff --git a/test/testcases/block/06_codeblock/highlighting-rouge.text b/test/testcases/block/06_codeblock/rouge/simple.text
similarity index 100%
rename from test/testcases/block/06_codeblock/highlighting-rouge.text
rename to test/testcases/block/06_codeblock/rouge/simple.text
diff --git a/test/testcases/span/03_codespan/rouge/disabled.html b/test/testcases/span/03_codespan/rouge/disabled.html
new file mode 100644
index 0000000..7822f78
--- /dev/null
+++ b/test/testcases/span/03_codespan/rouge/disabled.html
@@ -0,0 +1 @@
+<p>You can say <code class="language-ruby">Class</code>.</p>
diff --git a/test/testcases/block/06_codeblock/highlighting-rouge.options b/test/testcases/span/03_codespan/rouge/disabled.options
similarity index 67%
rename from test/testcases/block/06_codeblock/highlighting-rouge.options
rename to test/testcases/span/03_codespan/rouge/disabled.options
index f59e0ff..34094e9 100644
--- a/test/testcases/block/06_codeblock/highlighting-rouge.options
+++ b/test/testcases/span/03_codespan/rouge/disabled.options
@@ -1,3 +1,4 @@
 :syntax_highlighter: rouge
 :syntax_highlighter_opts:
-  default_lang: ruby
+  span:
+    disable: true
diff --git a/test/testcases/span/03_codespan/rouge/disabled.text b/test/testcases/span/03_codespan/rouge/disabled.text
new file mode 100644
index 0000000..d958d91
--- /dev/null
+++ b/test/testcases/span/03_codespan/rouge/disabled.text
@@ -0,0 +1 @@
+You can say `Class`{:.language-ruby}.
diff --git a/test/testcases/span/03_codespan/highlighting-rouge.html b/test/testcases/span/03_codespan/rouge/simple.html
similarity index 100%
rename from test/testcases/span/03_codespan/highlighting-rouge.html
rename to test/testcases/span/03_codespan/rouge/simple.html
diff --git a/test/testcases/span/03_codespan/highlighting-rouge.options b/test/testcases/span/03_codespan/rouge/simple.options
similarity index 100%
rename from test/testcases/span/03_codespan/highlighting-rouge.options
rename to test/testcases/span/03_codespan/rouge/simple.options
diff --git a/test/testcases/span/03_codespan/highlighting-rouge.text b/test/testcases/span/03_codespan/rouge/simple.text
similarity index 100%
rename from test/testcases/span/03_codespan/highlighting-rouge.text
rename to test/testcases/span/03_codespan/rouge/simple.text
diff --git a/test/testcases/span/04_footnote/without_backlink.html b/test/testcases/span/04_footnote/without_backlink.html
new file mode 100644
index 0000000..df5e917
--- /dev/null
+++ b/test/testcases/span/04_footnote/without_backlink.html
@@ -0,0 +1,9 @@
+<p>Some footnote here<sup id="fnref:fn"><a href="#fn:fn" class="footnote">1</a></sup></p>
+
+<div class="footnotes">
+  <ol>
+    <li id="fn:fn">
+      <p>Some text here</p>
+    </li>
+  </ol>
+</div>
diff --git a/test/testcases/span/04_footnote/without_backlink.options b/test/testcases/span/04_footnote/without_backlink.options
new file mode 100644
index 0000000..0512dd6
--- /dev/null
+++ b/test/testcases/span/04_footnote/without_backlink.options
@@ -0,0 +1 @@
+:footnote_backlink: ''
diff --git a/test/testcases/span/04_footnote/without_backlink.text b/test/testcases/span/04_footnote/without_backlink.text
new file mode 100644
index 0000000..41a6f98
--- /dev/null
+++ b/test/testcases/span/04_footnote/without_backlink.text
@@ -0,0 +1,3 @@
+Some footnote here[^fn]
+
+[^fn]: Some text here

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-kramdown.git



More information about the Pkg-ruby-extras-commits mailing list