r27625 - in /branches/upstream/libhtml-wikiconverter-moinmoin-perl/current: Changes META.yml Makefile.PL README lib/HTML/WikiConverter/MoinMoin.pm t/moinmoin.t t/pod-coverage.t t/runtests.pl

ryan52-guest at users.alioth.debian.org ryan52-guest at users.alioth.debian.org
Tue Dec 2 05:50:48 UTC 2008


Author: ryan52-guest
Date: Tue Dec  2 05:50:43 2008
New Revision: 27625

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=27625
Log:
[svn-upgrade] Integrating new upstream version, libhtml-wikiconverter-moinmoin-perl (0.54)

Modified:
    branches/upstream/libhtml-wikiconverter-moinmoin-perl/current/Changes
    branches/upstream/libhtml-wikiconverter-moinmoin-perl/current/META.yml
    branches/upstream/libhtml-wikiconverter-moinmoin-perl/current/Makefile.PL
    branches/upstream/libhtml-wikiconverter-moinmoin-perl/current/README
    branches/upstream/libhtml-wikiconverter-moinmoin-perl/current/lib/HTML/WikiConverter/MoinMoin.pm
    branches/upstream/libhtml-wikiconverter-moinmoin-perl/current/t/moinmoin.t
    branches/upstream/libhtml-wikiconverter-moinmoin-perl/current/t/pod-coverage.t
    branches/upstream/libhtml-wikiconverter-moinmoin-perl/current/t/runtests.pl

Modified: branches/upstream/libhtml-wikiconverter-moinmoin-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-wikiconverter-moinmoin-perl/current/Changes?rev=27625&op=diff
==============================================================================
--- branches/upstream/libhtml-wikiconverter-moinmoin-perl/current/Changes (original)
+++ branches/upstream/libhtml-wikiconverter-moinmoin-perl/current/Changes Tue Dec  2 05:50:43 2008
@@ -1,23 +1,30 @@
 # Change log for HTML::WikiConverter::MoinMoin
 
+version: 0.54
+date:    2008-10-16
+changes:
+  - (bug #40114) fix '=' counts in section headings
+  - (bug #29347) support anchors with content
+  - require H::WC 0.63, latest
+
 version: 0.53
-date:    Thu Jul 20 19:00:00 EST 2006
+date:    2006-07-20
 changes:
   - add attribute types
   - require Params::Validate
   - require HTML::WikiConverter 0.60
 
 version: 0.52
-date:    Wed June 07 15:00:00 EST 2006
+date:    2006-07-07
 changes:
   - (bug #17813) implement anchors
 
 version: 0.51
-date:    Tue Mar 21 2006
+date:    2006-03-21
 changes:
   - (bug #18083) fix tests that used 'strip_comments' attribute, which no longer exists
 
 version: 0.50
-date:    Tue Jan 10 2006
+date:    2006-01-10
 changes:
   - branched from main HTML::WikiConverter codebase.

Modified: branches/upstream/libhtml-wikiconverter-moinmoin-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-wikiconverter-moinmoin-perl/current/META.yml?rev=27625&op=diff
==============================================================================
--- branches/upstream/libhtml-wikiconverter-moinmoin-perl/current/META.yml (original)
+++ branches/upstream/libhtml-wikiconverter-moinmoin-perl/current/META.yml Tue Dec  2 05:50:43 2008
@@ -1,14 +1,23 @@
-# http://module-build.sourceforge.net/META-spec.html
-#XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
-name:         HTML-WikiConverter-MoinMoin
-version:      0.53
-version_from: lib/HTML/WikiConverter/MoinMoin.pm
-installdirs:  site
+--- #YAML:1.0
+name:               HTML-WikiConverter-MoinMoin
+version:            0.54
+abstract:           Convert HTML to MoinMoin markup
+author:
+    - David J. Iberri <diberri at cpan.org>
+license:            perl
+distribution_type:  module
+configure_requires:
+    ExtUtils::MakeMaker:  0
 requires:
-    HTML::WikiConverter:           0.5
-    Params::Validate:              0
-    Test::More:                    0
-    URI:                           0
-
-distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.17
+    HTML::WikiConverter:  0.63
+    Params::Validate:     0
+    Test::More:           0
+    URI:                  0
+no_index:
+    directory:
+        - t
+        - inc
+generated_by:       ExtUtils::MakeMaker version 6.48
+meta-spec:
+    url:      http://module-build.sourceforge.net/META-spec-v1.4.html
+    version:  1.4

Modified: branches/upstream/libhtml-wikiconverter-moinmoin-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-wikiconverter-moinmoin-perl/current/Makefile.PL?rev=27625&op=diff
==============================================================================
--- branches/upstream/libhtml-wikiconverter-moinmoin-perl/current/Makefile.PL (original)
+++ branches/upstream/libhtml-wikiconverter-moinmoin-perl/current/Makefile.PL Tue Dec  2 05:50:43 2008
@@ -5,12 +5,13 @@
 WriteMakefile(
     NAME                => 'HTML::WikiConverter::MoinMoin',
     AUTHOR              => 'David J. Iberri <diberri at cpan.org>',
+    LICENSE             => 'perl',
     VERSION_FROM        => 'lib/HTML/WikiConverter/MoinMoin.pm',
     ABSTRACT_FROM       => 'lib/HTML/WikiConverter/MoinMoin.pm',
     PL_FILES            => {},
     PREREQ_PM => {
         'Test::More' => 0,
-        'HTML::WikiConverter' => 0.50,
+        'HTML::WikiConverter' => 0.63,
         'Params::Validate' => 0,
         'URI' => 0,
     },

Modified: branches/upstream/libhtml-wikiconverter-moinmoin-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-wikiconverter-moinmoin-perl/current/README?rev=27625&op=diff
==============================================================================
--- branches/upstream/libhtml-wikiconverter-moinmoin-perl/current/README (original)
+++ branches/upstream/libhtml-wikiconverter-moinmoin-perl/current/README Tue Dec  2 05:50:43 2008
@@ -20,19 +20,6 @@
 There's also a web interface if you're so inclined:
 
   http://diberri.dyndns.org/wikipedia/html2wiki/
-
-CHANGES IN 0.53
-
-  * Update for HTML::WikiConverter 0.60
-
-INSTALLATION
-
-To install this module, run the following commands:
-
-    perl Makefile.PL
-    make
-    make test
-    make install
 
 SUPPORT AND DOCUMENTATION
 
@@ -57,7 +44,7 @@
 
 COPYRIGHT AND LICENCE
 
-Copyright (C) 2006 David J. Iberri
+Copyright (c) David J. Iberri
 
 This program is free software; you can redistribute it and/or modify
 it under the same terms as Perl itself.

Modified: branches/upstream/libhtml-wikiconverter-moinmoin-perl/current/lib/HTML/WikiConverter/MoinMoin.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-wikiconverter-moinmoin-perl/current/lib/HTML/WikiConverter/MoinMoin.pm?rev=27625&op=diff
==============================================================================
--- branches/upstream/libhtml-wikiconverter-moinmoin-perl/current/lib/HTML/WikiConverter/MoinMoin.pm (original)
+++ branches/upstream/libhtml-wikiconverter-moinmoin-perl/current/lib/HTML/WikiConverter/MoinMoin.pm Tue Dec  2 05:50:43 2008
@@ -4,7 +4,7 @@
 use strict;
 
 use base 'HTML::WikiConverter';
-our $VERSION = '0.53';
+our $VERSION = '0.54';
 
 use Params::Validate ':types';
 use URI;
@@ -63,16 +63,15 @@
     tr => { end => "||\n", line_format => 'single' },
     td => { start => \&_td_start, end => ' ', trim => 'both' },
     th => { alias => 'td' },
+
+    # (bug #40114) http://moinmo.in/HelpOnHeadlines
+    h1 => { start => '= ',      end => ' =',      block => 1, trim => 'both', line_format => 'single' },
+    h2 => { start => '== ',     end => ' ==',     block => 1, trim => 'both', line_format => 'single' },
+    h3 => { start => '=== ',    end => ' ===',    block => 1, trim => 'both', line_format => 'single' },
+    h4 => { start => '==== ',   end => ' ====',   block => 1, trim => 'both', line_format => 'single' },
+    h5 => { start => '===== ',  end => ' =====',  block => 1, trim => 'both', line_format => 'single' },
+    h6 => { start => '====== ', end => ' ======', block => 1, trim => 'both', line_format => 'single' },
   );
-
-  # Headings (h1-h6)
-  my @headings = ( 1..6 );
-  foreach my $level ( @headings ) {
-    my $tag = "h$level";
-    my $affix = ( '=' ) x ($level+1);
-    $affix = '======' if $level == 6;
-    $rules{$tag} = { start => $affix.' ', end => ' '.$affix, block => 1, trim => 'both', line_format => 'single' };
-  }
 
   return \%rules;
 }
@@ -151,20 +150,24 @@
 sub _link {
   my( $self, $node, $rules ) = @_;
 
-  # (bug #17813)
-  my $name = $node->attr('name');
-  return sprintf '[[Anchor(%s)]]', $name if $self->enable_anchor_macro and $name;
+  # bug #17813 requests anchors; MoinMoin:HelpOnMacros gives new
+  # "<<Anchor(name)>>" syntax for anchors and other macros (this was
+  # previously "[[Anchor(name)]]" sometime prior to 2008-10-01)
+
+  # bug #29347 requests 'id' be favored over 'name'
+  my $anchor_name = $node->attr('id') || $node->attr('name');
+  return sprintf( "<<Anchor(%s)>>\n", $anchor_name ) if $self->enable_anchor_macro and $anchor_name;
 
   my $url = $node->attr('href') || '';
   my $text = $self->get_elem_contents($node) || '';
 
-  # (bug #17813)
+  # bug #17813
   if( $self->_abs2rel($url) =~ /^#/ ) {
     $url = $self->_abs2rel($url);
   }
 
   return $url if $url eq $text;
-  return "[$url $text]";
+  return "[[$url|$text]]";
 }
 
 sub _abs2rel {
@@ -180,23 +183,24 @@
 
 sub preprocess_node {
   my( $self, $node ) = @_;
-  $self->strip_aname($node) if $node->tag eq 'a';
-  $self->caption2para($node) if $node->tag eq 'caption';
-
-  # (bug #17813)
-  if( $node->tag eq 'a' and $node->attr('name') ) {
-    my $name = $node->attr('name');
-    $node->preinsert( new HTML::Element('a', name => $name) );
-    $node->attr( name => undef );
-  }
+  my $tag = $node->tag || '';
+
+  $self->caption2para($node) if $tag eq 'caption';
+
+  # Find something like <a id="some anchor here" name="or here">and content here</a>
+  if( $node->tag eq 'a' and ( $node->attr('name') or $node->attr('id') ) and !$node->attr('href') and $self->get_elem_contents($node) ) {
+    my $anchor_name = $node->attr('id') || $node->attr('name');
+    $node->preinsert( new HTML::Element('a', name => $anchor_name) );
+    $node->replace_with_content->delete();
+   }
 }
 
 my @protocols = qw( http https mailto );
-my $urls  = '(' . join('|', @protocols) . ')';
-my $ltrs  = '\w';
-my $gunk  = '\/\#\~\:\.\?\+\=\&\%\@\!\-';
-my $punc  = '\.\:\?\-\{\(\)\}';
-my $any   = "${ltrs}${gunk}${punc}";
+my $urls   = '(' . join('|', @protocols) . ')';
+my $ltrs   = '\w';
+my $gunk   = '\/\#\~\:\.\?\+\=\&\%\@\!\-';
+my $punc   = '\.\:\?\-\{\(\)\}';
+my $any    = "${ltrs}${gunk}${punc}";
 my $url_re = "\\b($urls:\[$any\]+?)(?=\[$punc\]*\[^$any\])";
 
 sub postprocess_output {
@@ -247,7 +251,7 @@
 
 =head1 COPYRIGHT & LICENSE
 
-Copyright 2006 David J. Iberri, all rights reserved.
+Copyright (c) David J. Iberri, all rights reserved.
 
 This program is free software; you can redistribute it and/or modify
 it under the same terms as Perl itself.

Modified: branches/upstream/libhtml-wikiconverter-moinmoin-perl/current/t/moinmoin.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-wikiconverter-moinmoin-perl/current/t/moinmoin.t?rev=27625&op=diff
==============================================================================
--- branches/upstream/libhtml-wikiconverter-moinmoin-perl/current/t/moinmoin.t (original)
+++ branches/upstream/libhtml-wikiconverter-moinmoin-perl/current/t/moinmoin.t Tue Dec  2 05:50:43 2008
@@ -15,7 +15,7 @@
 <a href="http://google.com">GOOGLE</a><br/>
 NewLine
 __W__
-[http://google.com GOOGLE][[BR]] NewLine
+[[http://google.com|GOOGLE]][[BR]] NewLine
 __NEXT__
 bold
 __H__
@@ -160,31 +160,31 @@
 __H__
 <h1>h1</h1>
 __W__
-== h1 ==
+= h1 =
 __NEXT__
 h2
 __H__
 <h2>h2</h2>
 __W__
-=== h2 ===
+== h2 ==
 __NEXT__
 h3
 __H__
 <h3>h3</h3>
 __W__
-==== h3 ====
+=== h3 ===
 __NEXT__
 h4
 __H__
 <h4>h4</h4>
 __W__
-===== h4 =====
+==== h4 ====
 __NEXT__
 h5
 __H__
 <h5>h5</h5>
 __W__
-====== h5 ======
+===== h5 =====
 __NEXT__
 h6
 __H__
@@ -202,7 +202,7 @@
 __H__
 <html><a href="test.html">thing</a></html>
 __W__
-[http://www.test.com/test.html thing]
+[[http://www.test.com/test.html|thing]]
 __NEXT__
 external link (plain)
 __H__
@@ -239,8 +239,19 @@
 ||<-2 tablestyle="width:100%; background-color:white" id="thing"> thing ||
 || next ||<id="crazy"> crazy ||
 __NEXT__
+anchors with content (bug #29347) ::enable_anchor_macro(1)
+__H__
+<a id="top">This is the top of the page</a>
+__W__
+<<Anchor(top)>>
+This is the top of the page
+__NEXT__
 anchors (bug #17813) ::enable_anchor_macro(1)
 __H__
-<p><a name="here" href="#here">here</a></p>
-__W__
-[[Anchor(here)]][#here here]
+<a id="id-top" name="name-top"></a>
+
+<p><a href="#href-top">Top of page</a></p>
+__W__
+<<Anchor(id-top)>>
+
+[[#href-top|Top of page]]

Modified: branches/upstream/libhtml-wikiconverter-moinmoin-perl/current/t/pod-coverage.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-wikiconverter-moinmoin-perl/current/t/pod-coverage.t?rev=27625&op=diff
==============================================================================
--- branches/upstream/libhtml-wikiconverter-moinmoin-perl/current/t/pod-coverage.t (original)
+++ branches/upstream/libhtml-wikiconverter-moinmoin-perl/current/t/pod-coverage.t Tue Dec  2 05:50:43 2008
@@ -9,6 +9,7 @@
      get_elem_contents
     |get_wiki_page
     |get_attr_str
+    |elem_within_block
     |is_camel_case
     |rule
     |rules

Modified: branches/upstream/libhtml-wikiconverter-moinmoin-perl/current/t/runtests.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-wikiconverter-moinmoin-perl/current/t/runtests.pl?rev=27625&op=diff
==============================================================================
--- branches/upstream/libhtml-wikiconverter-moinmoin-perl/current/t/runtests.pl (original)
+++ branches/upstream/libhtml-wikiconverter-moinmoin-perl/current/t/runtests.pl Tue Dec  2 05:50:43 2008
@@ -76,15 +76,37 @@
     my( $html, $wiki ) = split /__W__\n/, $test;
     $html =~ s/__H__\n//;
 
+#    $name =~ s{\s*\:\:(\w+\([^\)]*?\))}{
+#      my $method_call = $1;
+#      eval "\$wc->$method_call;";
+#      die "Failed test call ($name): $@" if $@;
+#      '';
+#    }ge;
+
+    my( $todo, $todo_reason );
     $name =~ s{\s*\:\:(\w+\([^\)]*?\))}{
-      my $method_call = $1;
-      eval "\$wc->$method_call;";
-      die "Failed test call ($name): $@" if $@;
+      my $keyword = $1;
+      if( $keyword =~ /TODO\((\"|\')(.*?)\1/ ) {
+        $todo = 1;
+        $todo_reason = $2;
+      } else {
+        my $method_call = $keyword;
+        eval "\$wc->$method_call;";
+        die "Failed test call ($name): $@" if $@;
+      }
       '';
     }ge;
 
     for( $html, $wiki ) { s/^\n+//; s/\n+$// }
-    is( $wc->html2wiki($html), $wiki, $name );
+
+    if( $todo ) {
+      TODO: {
+        local $TODO = $todo_reason;
+        is( $wc->html2wiki($html), $wiki, $name );
+      }
+    } else {
+      is( $wc->html2wiki($html), $wiki, $name );
+    }
   }
 
   #file_test($wc) unless $minimal;




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