[Rt-commit] rt branch, 3.8-html-templates, updated. rt-3.8.7-277-g9492120
Kevin Falcone
falcone at bestpractical.com
Tue Nov 16 16:30:14 EST 2010
The branch, 3.8-html-templates has been updated
via 9492120561823d19b8e5fc32997fe893ebe38d50 (commit)
from 3dbf6e4fd388839893528c8ef322256fee0b82ce (commit)
Summary of changes:
lib/RT/Template_Overlay.pm | 12 ++----------
lib/RT/Transaction_Overlay.pm | 10 ++--------
2 files changed, 4 insertions(+), 18 deletions(-)
- Log -----------------------------------------------------------------
commit 9492120561823d19b8e5fc32997fe893ebe38d50
Author: Kevin Falcone <falcone at bestpractical.com>
Date: Fri Apr 2 14:05:24 2010 -0400
quick test replacement using WithLinks::AndTables because it displays tables better
diff --git a/lib/RT/Template_Overlay.pm b/lib/RT/Template_Overlay.pm
index fce37bc..ec181cf 100755
--- a/lib/RT/Template_Overlay.pm
+++ b/lib/RT/Template_Overlay.pm
@@ -440,18 +440,10 @@ sub _DowngradeFromHTML {
$orig_entity->head->mime_attr( "Content-Type.charset" => 'utf-8' );
$orig_entity->make_multipart('alternative', Force => 1);
- require HTML::FormatText;
- require HTML::TreeBuilder;
- my $tree = HTML::TreeBuilder->new_from_content(
- $new_entity->bodyhandle->as_string
- );
+ require HTML::FormatText::WithLinks::AndTables;
$new_entity->bodyhandle(MIME::Body::InCore->new(
- \(scalar HTML::FormatText->new(
- leftmargin => 0,
- rightmargin => 78,
- )->format( $tree ))
+ \( HTML::FormatText::WithLinks::AndTables->convert($new_entity->bodyhandle->as_string, { no_rowspacing => 1 }) )
));
- $tree->delete;
$orig_entity->add_part($new_entity, 0); # plain comes before html
$self->{MIMEObj} = $orig_entity;
diff --git a/lib/RT/Transaction_Overlay.pm b/lib/RT/Transaction_Overlay.pm
index 96ccf51..146ba40 100755
--- a/lib/RT/Transaction_Overlay.pm
+++ b/lib/RT/Transaction_Overlay.pm
@@ -80,8 +80,7 @@ use RT::Attachments;
use RT::Scrips;
use RT::Ruleset;
-use HTML::FormatText;
-use HTML::TreeBuilder;
+use HTML::FormatText::WithLinks::AndTables;
# {{{ sub Create
@@ -313,12 +312,7 @@ sub Content {
$content =~ s/<p>--\s+<br \/>.*?$//s if $args{'Quote'};
if ($args{Type} ne 'text/html') {
- my $tree = HTML::TreeBuilder->new_from_content( $content );
- $content = HTML::FormatText->new(
- leftmargin => 0,
- rightmargin => 78,
- )->format( $tree);
- $tree->delete;
+ $content = HTML::FormatText::WithLinks::AndTables->convert($content, { no_rowspacing => 1 });
}
}
else {
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list