r27065 - in /branches/upstream/libtext-markdown-perl/current: Changes MANIFEST META.yml lib/Text/Markdown.pm lib/Text/MultiMarkdown.pm t/03podspelling.t t/40trustliststart.t

ansgar-guest at users.alioth.debian.org ansgar-guest at users.alioth.debian.org
Sat Nov 22 11:15:44 UTC 2008


Author: ansgar-guest
Date: Sat Nov 22 11:15:41 2008
New Revision: 27065

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=27065
Log:
[svn-upgrade] Integrating new upstream version, libtext-markdown-perl (1.0.24)

Added:
    branches/upstream/libtext-markdown-perl/current/t/40trustliststart.t
Modified:
    branches/upstream/libtext-markdown-perl/current/Changes
    branches/upstream/libtext-markdown-perl/current/MANIFEST
    branches/upstream/libtext-markdown-perl/current/META.yml
    branches/upstream/libtext-markdown-perl/current/lib/Text/Markdown.pm
    branches/upstream/libtext-markdown-perl/current/lib/Text/MultiMarkdown.pm
    branches/upstream/libtext-markdown-perl/current/t/03podspelling.t

Modified: branches/upstream/libtext-markdown-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtext-markdown-perl/current/Changes?rev=27065&op=diff
==============================================================================
--- branches/upstream/libtext-markdown-perl/current/Changes (original)
+++ branches/upstream/libtext-markdown-perl/current/Changes Sat Nov 22 11:15:41 2008
@@ -199,3 +199,9 @@
           
 1.0.23 2008-11-02T18:24:30
         - Ship a release with the correct contents so that the tests pass.
+
+1.0.24 2008-11-16T14:33:30
+        - Add trust_list_start_value patch from Ricardo Signes (RT#40814)
+          to enable <li value='X'> output for list numbering.
+          This feature is disabled by default.
+

Modified: branches/upstream/libtext-markdown-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtext-markdown-perl/current/MANIFEST?rev=27065&op=diff
==============================================================================
--- branches/upstream/libtext-markdown-perl/current/MANIFEST (original)
+++ branches/upstream/libtext-markdown-perl/current/MANIFEST Sat Nov 22 11:15:41 2008
@@ -59,6 +59,7 @@
 t/37anchormultilinebugs.t
 t/38listshorizontalrule.t
 t/39listsindentededgecase.t
+t/40trustliststart.t
 t/code-hr.t
 t/docs-maruku-unittest/abbreviations.html
 t/docs-maruku-unittest/abbreviations.text

Modified: branches/upstream/libtext-markdown-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtext-markdown-perl/current/META.yml?rev=27065&op=diff
==============================================================================
--- branches/upstream/libtext-markdown-perl/current/META.yml (original)
+++ branches/upstream/libtext-markdown-perl/current/META.yml Sat Nov 22 11:15:41 2008
@@ -26,4 +26,4 @@
   perl: 5.8.0
 resources:
   repository: http://svn.kulp.ch/cpan/text_multimarkdown
-version: 1.0.23
+version: 1.0.24

Modified: branches/upstream/libtext-markdown-perl/current/lib/Text/Markdown.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtext-markdown-perl/current/lib/Text/Markdown.pm?rev=27065&op=diff
==============================================================================
--- branches/upstream/libtext-markdown-perl/current/lib/Text/Markdown.pm (original)
+++ branches/upstream/libtext-markdown-perl/current/lib/Text/Markdown.pm Sat Nov 22 11:15:41 2008
@@ -9,7 +9,7 @@
 use Carp        qw(croak);
 use base        'Exporter';
 
-our $VERSION   = '1.0.23';
+our $VERSION   = '1.0.24';
 our @EXPORT_OK = qw(markdown);
 
 =head1 NAME
@@ -67,7 +67,7 @@
 
 =over
 
-=item empty element suffix
+=item empty_element_suffix
 
 This option can be used to generate normal HTML output. By default, it is ' />', which is xHTML, change to '>' for normal HTML.
 
@@ -78,6 +78,21 @@
 =item markdown_in_html_blocks
 
 Controls if Markdown is processed when inside HTML blocks. Defaults to 0.
+
+=item trust_list_start_value
+
+If true, ordered lists will use the first number as the starting point for
+numbering.  This will let you pick up where you left off by writing:
+
+  1. foo
+  2. bar
+
+  some paragraph
+
+  3. baz
+  6. quux
+
+(Note that in the above, quux will be numbered 4.)
 
 =back
 
@@ -133,6 +148,8 @@
         
     # Is markdown processed in HTML blocks? See t/15inlinehtmldonotturnoffmarkdown.t
     $p{markdown_in_html_blocks} = $p{markdown_in_html_blocks} ? 1 : 0;
+
+    $p{trust_list_start_value} = $p{trust_list_start_value} ? 1 : 0;
     
     my $self = { params => \%p };
     bless $self, ref($class) || $class;
@@ -927,14 +944,16 @@
                 $whole_list
             }{
                 my $list = $1;
-                my $list_type = ($3 =~ m/$marker_ul/) ? "ul" : "ol";
+                my $marker = $3;
+                my $list_type = ($marker =~ m/$marker_ul/) ? "ul" : "ol";
                 # Turn double returns into triple returns, so that we can make a
                 # paragraph for the last item in a list, if necessary:
                 $list =~ s/\n{2,}/\n\n\n/g;
                 my $result = ( $list_type eq 'ul' ) ?
                     $self->_ProcessListItemsUL($list, $marker_ul)
                   : $self->_ProcessListItemsOL($list, $marker_ol);
-                $result = "<$list_type>\n" . $result . "</$list_type>\n";
+
+                $result = $self->_MakeList($list_type, $result, $marker);
                 $result;
             }egmx;
     }
@@ -944,20 +963,32 @@
                 $whole_list
             }{
                 my $list = $1;
-                my $list_type = ($3 =~ m/$marker_ul/) ? "ul" : "ol";
+                my $marker = $3;
+                my $list_type = ($marker =~ m/$marker_ul/) ? "ul" : "ol";
                 # Turn double returns into triple returns, so that we can make a
                 # paragraph for the last item in a list, if necessary:
                 $list =~ s/\n{2,}/\n\n\n/g;
                 my $result = ( $list_type eq 'ul' ) ?
                     $self->_ProcessListItemsUL($list, $marker_ul)
                   : $self->_ProcessListItemsOL($list, $marker_ol);
-                $result = "<$list_type>\n" . $result . "</$list_type>\n";
+                $result = $self->_MakeList($list_type, $result, $marker);
                 $result;
             }egmx;
     }
 
 
     return $text;
+}
+
+sub _MakeList {
+  my ($self, $list_type, $content, $marker) = @_;
+
+  if ($list_type eq 'ol' and $self->{trust_list_start_value}) {
+    my ($num) = $marker =~ /^(\d+)[.]/;
+    return "<ol start='$num'>\n" . $content . "</ol>\n";
+  }
+
+  return "<$list_type>\n" . $content . "</$list_type>\n";
 }
 
 sub _ProcessListItemsOL {

Modified: branches/upstream/libtext-markdown-perl/current/lib/Text/MultiMarkdown.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtext-markdown-perl/current/lib/Text/MultiMarkdown.pm?rev=27065&op=diff
==============================================================================
--- branches/upstream/libtext-markdown-perl/current/lib/Text/MultiMarkdown.pm (original)
+++ branches/upstream/libtext-markdown-perl/current/lib/Text/MultiMarkdown.pm Sat Nov 22 11:15:41 2008
@@ -9,7 +9,7 @@
 use Carp        qw(croak);
 use base        qw(Text::Markdown);
 
-our $VERSION   = '1.0.23';
+our $VERSION   = '1.0.24';
 our @EXPORT_OK = qw(markdown);
 
 =head1 NAME

Modified: branches/upstream/libtext-markdown-perl/current/t/03podspelling.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtext-markdown-perl/current/t/03podspelling.t?rev=27065&op=diff
==============================================================================
--- branches/upstream/libtext-markdown-perl/current/t/03podspelling.t (original)
+++ branches/upstream/libtext-markdown-perl/current/t/03podspelling.t Sat Nov 22 11:15:41 2008
@@ -47,3 +47,5 @@
 XHTML
 html
 shortversion
+quux
+

Added: branches/upstream/libtext-markdown-perl/current/t/40trustliststart.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtext-markdown-perl/current/t/40trustliststart.t?rev=27065&op=file
==============================================================================
--- branches/upstream/libtext-markdown-perl/current/t/40trustliststart.t (added)
+++ branches/upstream/libtext-markdown-perl/current/t/40trustliststart.t Sat Nov 22 11:15:41 2008
@@ -1,0 +1,33 @@
+use strict;
+use warnings;
+use Test::More tests => 2;
+
+use_ok( 'Text::Markdown' );
+
+my $m     = Text::Markdown->new(trust_list_start_value => 1);
+my $html1 = $m->markdown(<<"EOF");
+1. this
+2. is a list
+
+Paragraph.
+
+3. and we
+4. pick up
+
+EOF
+
+my $want = <<'EOF';
+<ol start='1'>
+<li>this</li>
+<li>is a list</li>
+</ol>
+
+<p>Paragraph.</p>
+
+<ol start='3'>
+<li>and we</li>
+<li>pick up</li>
+</ol>
+EOF
+
+is($html1, $want, "we can use numbering from start marker");




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