From 27b1446201f191157f3c72033aeaa14304b4f36c Mon Sep 17 00:00:00 2001 From: Michael Lang Date: Wed, 17 Nov 2010 00:31:41 +0100 Subject: [PATCH] Reduce the errors in epub (ebubcheck http://threepress.org/document/epub-validate/) from nearly 450 to under 50. --- build/tools/build_epub.pl | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/build/tools/build_epub.pl b/build/tools/build_epub.pl index ad91d376..ad1b61c6 100755 --- a/build/tools/build_epub.pl +++ b/build/tools/build_epub.pl @@ -255,7 +255,7 @@ sub add_cover . qq[\n] . qq[\n] . qq[\n] - . qq[ Modern Perl\n] + . qq[

Modern Perl

\n] . qq[\n] . qq[\n\n]; @@ -318,6 +318,9 @@ sub start_Document $self->emit('nowrap'); } +# Override Pod::PseudoPod::HTML open Z<> generated tags. +sub start_Z { $_[0]{'scratch'} .= '' } @@ -356,4 +359,20 @@ sub _end_head push @{$_[0]{'to_index'}}, [$h, $id, $text, $chapter]; } +# Override Pod::PseudoPod::HTML U<> to prevent deprecated tag. +sub start_U { $_[0]{'scratch'} .= '' if $_[0]{'css_tags'} } +sub end_U { $_[0]{'scratch'} .= '' if $_[0]{'css_tags'} } + +# Override Pod::PseudoPod::HTML N<> to prevent deprecated tag. +sub start_N { + my ($self) = @_; + $self->{'scratch'} .= '' if ($self->{'css_tags'}); + $self->{'scratch'} .= ' (footnote: '; +} +sub end_N { + my ($self) = @_; + $self->{'scratch'} .= ')'; + $self->{'scratch'} .= '' if $self->{'css_tags'}; +} + __END__