[interchange-cvs] interchange - kwalsh modified
code/Filter/html2text.filter
interchange-cvs at icdevgroup.org
interchange-cvs at icdevgroup.org
Thu Feb 15 20:31:10 EST 2007
User: kwalsh
Date: 2007-02-16 01:31:10 GMT
Modified: code/Filter html2text.filter
Log:
* Further to the last commit that just "made it work", this commit
"makes it work better". The <p>, </p> and <br> now all get replaced
with a "\n" each, which renders a blank line between paragraphs.
Revision Changes Path
1.6 +3 -4 interchange/code/Filter/html2text.filter
rev 1.6, prev_rev 1.5
Index: html2text.filter
===================================================================
RCS file: /var/cvs/interchange/code/Filter/html2text.filter,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- html2text.filter 16 Feb 2007 01:14:17 -0000 1.5
+++ html2text.filter 16 Feb 2007 01:31:10 -0000 1.6
@@ -1,16 +1,15 @@
# Copyright 2002-2005 Interchange Development Group (http://www.icdevgroup.org/)
# Copyright 1996-2002 Red Hat, Inc.
# Licensed under the GNU GPL v2. See file LICENSE for details.
-# $Id: html2text.filter,v 1.5 2007/02/16 01:14:17 kwalsh Exp $
+# $Id: html2text.filter,v 1.6 2007/02/16 01:31:10 kwalsh Exp $
CodeDef html2text Filter
CodeDef html2text Description Simple html2text
CodeDef html2text Routine <<EOR
sub {
my $val = shift;
- $val =~ s|\s*<br\s*/?>\s*|\n|gi;
- $val =~ s|\s*</p>\s*||gi;
- $val =~ s|\s*<p>\s*|\n|gi;
+
+ $val =~ s%\s*<(?:br\s*/?|/?p)>\s*%\n%gi;
return $val;
}
EOR
More information about the interchange-cvs
mailing list