[SCM] Debian packaging of libpod-markdown-perl branch, master, updated. 63116ffdfb4bca2763b4f21c5b3092c416b7b6e8

Carl Fürstenberg azatoth at gmail.com
Thu Sep 8 01:40:24 UTC 2011


The following commit has been merged in the master branch:
commit c043910d65c7136a89413490c1dbbe4d0c48c2c2
Author: Carl Fürstenberg <azatoth at gmail.com>
Date:   Thu Sep 8 03:30:04 2011 +0200

    Adding patch to handle escaping of stars and stripes

diff --git a/debian/changelog b/debian/changelog
index a64e9fc..50403f1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,7 +7,10 @@ libpod-markdown-perl (1.110730-2) UNRELEASED; urgency=low
   * debian/copyright: Replace DEP5 Format-Specification URL from
     svn.debian.org to anonscm.debian.org URL.
 
- -- Ansgar Burchardt <ansgar at debian.org>  Wed, 27 Jul 2011 18:47:10 +0200
+  [ Carl Fürstenberg ]
+  * Adding patch to handle escaping of stars and stripes
+
+ -- Carl Fürstenberg <azatoth at gmail.com>  Thu, 08 Sep 2011 03:31:08 +0200
 
 libpod-markdown-perl (1.110730-1) unstable; urgency=low
 
diff --git a/debian/patches/0001-Escape-characters-that-can-have-a-special-meaning-in.patch b/debian/patches/0001-Escape-characters-that-can-have-a-special-meaning-in.patch
new file mode 100644
index 0000000..aef19c6
--- /dev/null
+++ b/debian/patches/0001-Escape-characters-that-can-have-a-special-meaning-in.patch
@@ -0,0 +1,80 @@
+From: =?UTF-8?q?Carl=20F=C3=BCrstenberg?= <azatoth at gmail.com>
+Date: Thu, 8 Sep 2011 03:08:00 +0200
+Subject: Escape characters that can have a special meaning in markdown
+
+Escaping * and _ in verbatim and textblocks as they have special
+meanings in markdown as emphasis
+---
+ lib/Pod/Markdown.pm |    9 +++++++++
+ t/misc.t            |   11 ++++++++++-
+ 2 files changed, 19 insertions(+), 1 deletions(-)
+
+diff --git a/lib/Pod/Markdown.pm b/lib/Pod/Markdown.pm
+index c58c282..781fcae 100644
+--- a/lib/Pod/Markdown.pm
++++ b/lib/Pod/Markdown.pm
+@@ -82,8 +82,15 @@ sub _indent_text {
+ sub _clean_text {
+     my $text    = $_[1];
+     my @trimmed = grep { $_; } split(/\n/, $text);
++
+     return wantarray ? @trimmed : join("\n", @trimmed);
+ }
++sub _escape {
++	my $text = $_[1];
++	# escape stars and stripes as they are interpret in markdown as emphasis
++	$text =~ s/(\_|\*)/\\$1/g;
++	return $text;
++}
+ 
+ sub command {
+     my ($parser, $command, $paragraph, $line_num) = @_;
+@@ -145,12 +152,14 @@ sub command {
+ 
+ sub verbatim {
+     my ($parser, $paragraph) = @_;
++	$paragraph = $parser->_escape($paragraph);
+     $parser->_save($paragraph);
+ }
+ 
+ sub textblock {
+     my ($parser, $paragraph, $line_num) = @_;
+     my $data = $parser->_private;
++	$paragraph = $parser->_escape($paragraph);
+ 
+     # interpolate the paragraph for embebed sequences
+     $paragraph = $parser->interpolate($paragraph, $line_num);
+diff --git a/t/misc.t b/t/misc.t
+index 3f94c3e..135acea 100755
+--- a/t/misc.t
++++ b/t/misc.t
+@@ -15,7 +15,7 @@ pod2markdown - Convert POD text to Markdown
+ 
+ # SYNOPSIS
+ 
+-    $ pod2markdown < POD_File > Markdown_File
++    $ pod2markdown < POD\_File > Markdown\_File
+ 
+ # DESCRIPTION
+ 
+@@ -50,6 +50,11 @@ item
+ 
+ - list
+ - test
++
++# Special characters
++
++	foo\_bar is the result of 4 \* 4
++
+ EOMARKDOWN
+ 
+ 1 while chomp $markdown;
+@@ -112,3 +117,7 @@ list
+ =item * test
+ 
+ =back
++
++=head1 Special characters
++
++	foo_bar is the result of 4 * 4
+-- 
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..b4e6947
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+0001-Escape-characters-that-can-have-a-special-meaning-in.patch

-- 
Debian packaging of libpod-markdown-perl



More information about the Pkg-perl-cvs-commits mailing list