[DRE-commits] [ruby-redcarpet] 01/01: Imported Upstream version 3.2.3

Lucas Nussbaum lucas at moszumanska.debian.org
Wed May 6 10:24:51 UTC 2015


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

lucas pushed a commit to annotated tag upstream/3.2.3
in repository ruby-redcarpet.

commit 34b3106f524501fd5850df0e562ff7a711dfb833
Author: Lucas Nussbaum <lucas at debian.org>
Date:   Wed May 6 11:14:31 2015 +0200

    Imported Upstream version 3.2.3
---
 ext/redcarpet/html_blocks.h | 16 +++++++++-------
 ext/redcarpet/markdown.c    |  5 +++--
 lib/redcarpet.rb            |  5 +++--
 metadata.yml                |  4 ++--
 redcarpet.gemspec           |  4 ++--
 test/html5_test.rb          |  9 +++++++++
 test/markdown_test.rb       | 12 ++++++++++++
 7 files changed, 40 insertions(+), 15 deletions(-)

diff --git a/ext/redcarpet/html_blocks.h b/ext/redcarpet/html_blocks.h
index d74c176..1cb80e9 100644
--- a/ext/redcarpet/html_blocks.h
+++ b/ext/redcarpet/html_blocks.h
@@ -1,5 +1,6 @@
 /* C code produced by gperf version 3.0.4 */
 /* Command-line: gperf -N find_block_tag -H hash_block_tag -C -c -E --ignore-case html_block_names.txt  */
+/* See http://git.io/RN0ncw for the list of recognized elements */
 /* Computed positions: -k'1-2' */
 
 #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
@@ -99,10 +100,10 @@ hash_block_tag (str, len)
       68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
       68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
       55, 50, 45, 40, 35, 30, 68, 68, 68, 68,
-      68, 68, 68, 68, 68, 15, 10,  5, 15, 15,
+      68, 68, 68, 68, 68, 15, 10, 15, 15, 15,
        0, 20, 10, 10,  5, 68, 68,  0, 20, 25,
        0, 68, 68,  0, 25,  0, 15, 68, 68, 68,
-      68, 68, 68, 68, 68, 68, 68, 15, 10,  5,
+      68, 68, 68, 68, 68, 68, 68, 15, 10, 15,
       15, 15,  0, 20, 10, 10,  5, 68, 68,  0,
       20, 25,  0, 68, 68,  0, 25,  0, 15, 68,
       68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
@@ -147,7 +148,7 @@ find_block_tag (str, len)
 {
   enum
     {
-      TOTAL_KEYWORDS = 40,
+      TOTAL_KEYWORDS = 41,
       MIN_WORD_LENGTH = 1,
       MAX_WORD_LENGTH = 10,
       MIN_HASH_VALUE = 1,
@@ -175,18 +176,19 @@ find_block_tag (str, len)
       "del",
       "",
       "blockquote",
-      "canvas",
+      "script",
       "article",
       "div",
-      "abbr",
+      "",
       "video",
       "hgroup",
       "ol",
       "noscript",
-      "", "", "",
+      "", "",
+      "canvas",
       "dd",
       "nav",
-      "",
+      "abbr",
       "audio",
       "iframe",
       "address",
diff --git a/ext/redcarpet/markdown.c b/ext/redcarpet/markdown.c
index a218f21..8598afc 100644
--- a/ext/redcarpet/markdown.c
+++ b/ext/redcarpet/markdown.c
@@ -461,7 +461,7 @@ tag_length(uint8_t *data, size_t size, enum mkd_autolink *autolink)
 static void
 parse_inline(struct buf *ob, struct sd_markdown *rndr, uint8_t *data, size_t size)
 {
-	size_t i = 0, end = 0;
+	size_t i = 0, end = 0, consumed = 0;
 	uint8_t action = 0;
 	struct buf work = { 0, 0, 0, 0 };
 
@@ -486,12 +486,13 @@ parse_inline(struct buf *ob, struct sd_markdown *rndr, uint8_t *data, size_t siz
 		if (end >= size) break;
 		i = end;
 
-		end = markdown_char_ptrs[(int)action](ob, rndr, data + i, i, size - i);
+		end = markdown_char_ptrs[(int)action](ob, rndr, data + i, i - consumed, size - i);
 		if (!end) /* no action from the callback */
 			end = i + 1;
 		else {
 			i += end;
 			end = i;
+			consumed = i;
 		}
 	}
 }
diff --git a/lib/redcarpet.rb b/lib/redcarpet.rb
index d6fd075..045bda7 100644
--- a/lib/redcarpet.rb
+++ b/lib/redcarpet.rb
@@ -1,7 +1,8 @@
 require 'redcarpet.so'
+require 'redcarpet/compat'
 
 module Redcarpet
-  VERSION = '3.2.0'
+  VERSION = '3.2.3'
 
   class Markdown
     attr_reader :renderer
@@ -53,7 +54,7 @@ module Redcarpet
           '>' => '>',
           '"' => '"',
           "'" => '&#x27;',
-          "/" => '&#x2F',
+          "/" => '&#x2F;',
         })
       end
     end
diff --git a/metadata.yml b/metadata.yml
index 4ed1183..2e43ffa 100644
--- a/metadata.yml
+++ b/metadata.yml
@@ -1,7 +1,7 @@
 --- !ruby/object:Gem::Specification
 name: redcarpet
 version: !ruby/object:Gem::Version
-  version: 3.2.0
+  version: 3.2.3
 platform: ruby
 authors:
 - Natacha Porté
@@ -9,7 +9,7 @@ authors:
 autorequire: 
 bindir: bin
 cert_chain: []
-date: 2014-10-11 00:00:00.000000000 Z
+date: 2015-04-05 00:00:00.000000000 Z
 dependencies:
 - !ruby/object:Gem::Dependency
   name: nokogiri
diff --git a/redcarpet.gemspec b/redcarpet.gemspec
index 8950685..d59f8a2 100644
--- a/redcarpet.gemspec
+++ b/redcarpet.gemspec
@@ -1,10 +1,10 @@
 # encoding: utf-8
 Gem::Specification.new do |s|
   s.name = 'redcarpet'
-  s.version = '3.2.0'
+  s.version = '3.2.3'
   s.summary = "Markdown that smells nice"
   s.description = 'A fast, safe and extensible Markdown to (X)HTML parser'
-  s.date = '2014-10-11'
+  s.date = '2015-04-05'
   s.email = 'vicent at github.com'
   s.homepage = 'http://github.com/vmg/redcarpet'
   s.authors = ["Natacha Porté", "Vicent Martí"]
diff --git a/test/html5_test.rb b/test/html5_test.rb
index c30dfa7..1bc69d6 100644
--- a/test/html5_test.rb
+++ b/test/html5_test.rb
@@ -57,4 +57,13 @@ EOE
     assert_renders section_expected, section
     assert_renders header_expected, header
   end
+
+  def test_script_tag_recognition
+    markdown = <<-Md
+<script type="text/javascript">
+  alert('Foo!');
+</script>
+Md
+    assert_renders markdown, markdown
+  end
 end
diff --git a/test/markdown_test.rb b/test/markdown_test.rb
index 0287dca..65f7d3b 100644
--- a/test/markdown_test.rb
+++ b/test/markdown_test.rb
@@ -308,4 +308,16 @@ text
     markdown = @markdown.render("[Link][id]\n[id]:\t\t\thttp://google.es")
     html_equal "<p><a href=\"http://google.es\">Link</a></p>\n", markdown
   end
+
+  def test_no_rewind_into_previous_inline
+    result = "<p><em>!dl</em><a href=\"mailto:1 at danlec.com\">1 at danlec.com</a></p>\n"
+    output = render("_!dl_1 at danlec.com", with: [:autolink])
+
+    assert_equal result, output
+
+    result = "<p>abc123<em><a href=\"http://www.foo.com\">www.foo.com</a></em>@foo.com</p>\n"
+    output = render("abc123_www.foo.com_ at foo.com", with: [:autolink])
+
+    assert_equal result, output
+  end
 end

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



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