[perl-HTML-FormatText-WithLinks-AndTables/f16] New upstream
RĂ¼diger Landmann
rlandmann at fedoraproject.org
Thu Nov 22 00:33:41 UTC 2012
commit 70f222bde88391891737812914cab9963aa39480
Author: Ruediger Landmann <r.landmann at redhat.com>
Date: Thu Nov 22 10:43:25 2012 +1000
New upstream
.gitignore | 1 +
RT-74392.patch | 21 +++++++++++++++++++++
col_0_fix.patch | 21 +++++++++++++++++++++
perl-HTML-FormatText-WithLinks-AndTables.spec | 14 +++++++++-----
sources | 2 +-
5 files changed, 53 insertions(+), 6 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index de9afec..6b0dd73 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
/HTML-FormatText-WithLinks-AndTables-0.01.tar.gz
+/HTML-FormatText-WithLinks-AndTables-0.02.tar.gz
diff --git a/RT-74392.patch b/RT-74392.patch
new file mode 100644
index 0000000..e7411da
--- /dev/null
+++ b/RT-74392.patch
@@ -0,0 +1,21 @@
+diff -ur HTML-FormatText-WithLinks-AndTables/lib/HTML/FormatText/WithLinks/AndTables.pm HTML-FormatText-WithLinks-AndTab-patched/lib/HTML/FormatText/WithLinks/AndTables.pm
+--- HTML-FormatText-WithLinks-AndTables/lib/HTML/FormatText/WithLinks/AndTables.pm 2012-06-08 10:10:37.000000000 +1000
++++ HTML-FormatText-WithLinks-AndTab-patched/lib/HTML/FormatText/WithLinks/AndTables.pm 2012-07-24 16:17:19.964364582 +1000
+@@ -134,7 +134,7 @@
+ for my $tr (@trs) { # *** 1st pass over rows
+ $max_col_heights[$row_count] = 0;
+ $col_lines[$row_count] = [];
+- my @cols = $tr->look_down(_tag=>'td'); # no support for <th>. sorry.
++ my @cols = $tr->look_down(_tag=>qr/(td|th)/); # no support for <th>. sorry.
+ for (my $i = 0; $i < scalar @cols; $i++) {
+ my $td = $cols[$i]->clone;
+ my $new_tree = HTML::TreeBuilder->new;
+@@ -167,7 +167,7 @@
+ SECOND_PASS: {
+ my $row_count = 0; # obviously, another counter...
+ for my $tr (@trs) { # *** 2nd pass over rows
+- my @cols = $tr->look_down(_tag=>'td'); # no support for <th>. sorry.
++ my @cols = $tr->look_down(_tag=>qr/(td|th)/); # no support for <th>. sorry.
+
+ my $row_text; # the final string representing each row of reformatted text
+
diff --git a/col_0_fix.patch b/col_0_fix.patch
new file mode 100644
index 0000000..6ff0dda
--- /dev/null
+++ b/col_0_fix.patch
@@ -0,0 +1,21 @@
+diff -ur HTML-FormatText-WithLinks-AndTables/lib/HTML/FormatText/WithLinks/AndTables.pm HTML-FormatText-WithLinks-AndTab-patched/lib/HTML/FormatText/WithLinks/AndTables.pm
+--- HTML-FormatText-WithLinks-AndTables/lib/HTML/FormatText/WithLinks/AndTables.pm 2012-06-08 10:10:37.000000000 +1000
++++ HTML-FormatText-WithLinks-AndTab-patched/lib/HTML/FormatText/WithLinks/AndTables.pm 2012-07-24 16:25:07.631985777 +1000
+@@ -208,13 +208,15 @@
+ $new_line .= "\n" if $j != $max_col_heights[$row_count] - 1; # add a newline to all but the last text row
+ $col_rows[$j] = $new_line; # put the line into the stack for this row
+ }
+- $row_text .= $_ for @col_rows;
++ $row_text .= ($_ || '') for @col_rows; # BUGBUG this breaks on colspan in headers
+ for (my $i = 1; $i < scalar @cols; $i++) {
+ $cols[$i]->delete; # get rid of unneeded <td>'s
+ }
+ # put the fully formatted text into our accumulator
+ $formatted_tables->[$table_count]->[$row_count] = $row_text;
+- $cols[0]->content->[0] = "__TOKEN__${table_count}__${row_count}__"; # place a token into the row at col 0
++ if($cols[0]) { # BUGBUG this breaks on "complex" tables
++ $cols[0]->content->[0] = "__TOKEN__${table_count}__${row_count}__"; # place a token into the row at col 0
++ }
+ $row_count++;
+ }
+ }
diff --git a/perl-HTML-FormatText-WithLinks-AndTables.spec b/perl-HTML-FormatText-WithLinks-AndTables.spec
index 9b3b781..18fbb21 100644
--- a/perl-HTML-FormatText-WithLinks-AndTables.spec
+++ b/perl-HTML-FormatText-WithLinks-AndTables.spec
@@ -1,11 +1,13 @@
Name: perl-HTML-FormatText-WithLinks-AndTables
-Version: 0.01
-Release: 2%{?dist}.1
+Version: 0.02
+Release: 2%{?dist}
Summary: Converts HTML to Text with tables in tact
License: GPL+ or Artistic
Group: Development/Libraries
URL: http://search.cpan.org/dist/HTML-FormatText-WithLinks-AndTables/
Source0: http://www.cpan.org/authors/id/S/SF/SFRYER/HTML-FormatText-WithLinks-AndTables-%{version}.tar.gz
+Patch0: RT-74392.patch
+Patch1: col_0_fix.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: perl(ExtUtils::MakeMaker)
@@ -28,7 +30,9 @@ preserve multi-line text inside of a <TD> element provided it is broken
using <BR/> tags.
%prep
-%setup -q -n HTML-FormatText-WithLinks-AndTables-%{version}
+%setup -q -n HTML-FormatText-WithLinks-AndTables
+%patch0 -p 1
+%patch1 -p 1
%build
%{__perl} Makefile.PL INSTALLDIRS=vendor
@@ -57,8 +61,8 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man3/*
%changelog
-* Tue Sep 13 2011 Petr Pisar <ppisar at redhat.com> - 0.01-2.fc16.1
-- Rebuild against Perl 5.14
+* Tue Jul 24 2012 Jeff fearn <jfearn at redhat.com> 0.02-1
+- New Upstream
* Sun Jun 26 2011 RĂ¼diger Landmann <r.landmann at redhat.com> 0.01-2
- rm duplicate Requires
diff --git a/sources b/sources
index ec71c34..dc69fa9 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-0f6132d17056f2b2c20d03f31ea0c533 HTML-FormatText-WithLinks-AndTables-0.01.tar.gz
+804146aa9e49a5b1af4f63fecd9b0c28 HTML-FormatText-WithLinks-AndTables-0.02.tar.gz
More information about the perl-devel
mailing list