[Date Index][Thread Index]
[Date Prev][Date Next][Thread Prev][Thread Next]
Re: [BUG REPORT] WML 1.7.4 (Debian Revision 4), Debian GNU/Linux potato
- From: Denis Barbier <nospam@thanx>
- Date: Tue, 8 Feb 2000 18:52:21 +0100 (CET)
On Sat, 5 Feb 2000 erich.schubert@gmx.de wrote:
> BUG REPORT
>
> Package: WML 1.7.4 (Debian Revision 4)
> Operating System: Debian GNU/Linux potato
>
> Problem Description:
> | Known Bug, i think:
> | WML is stripping Spaces after closing Tags.
> | This can be _very_ annoying especially after
> | </A> Tags...
> | I'm using -O4
Indeed this is a known bug, but i forgot to put it on my TODO list.
Could you tell me whether the patch below fixes this problem?
You may apply it against wml_p8_htmlstrip as well.
--- htmlstrip.src 1999/06/09 19:15:24 1.2
+++ htmlstrip.src 2000/02/08 17:45:03
@@ -89,7 +89,7 @@
# Strip Plain Text, i.e. outside of any
# preformatted area and outside any HTML tag.
sub StripPlainText {
- my ($buf) = @_;
+ my ($before, $after, $buf) = @_;
# Level 0
#if ($opt_O >= 0) {
@@ -109,7 +109,19 @@
# Level 3
if ($opt_O >= 3) {
# strip leading whitespaces
- $buf =~ s|^\s+||mg;
+ if ($after) {
+ $buf =~ s|^\s+| |mg;
+ }
+ else {
+ $buf =~ s|^\s+||mg;
+ }
+ # strip trailing whitespaces
+ if ($before) {
+ $buf =~ s|\s+$||mg;
+ }
+ else {
+ $buf =~ s|\s+$| |mg;
+ }
}
# Level 4
if ($opt_O >= 4) {
@@ -248,15 +260,20 @@
sub StripNonPreformatted {
my ($I) = @_;
- my ($O);
+ my ($O, $L, $T, $A, $B);
$O = '';
+ $B = 0;
while ($I =~ m|^(.*?)(<.+?>)(.*)$|s) {
$I = $3;
- $O .= &StripPlainText($1);
- $O .= &StripHTMLTag($2);
+ $L = $1;
+ $T = $2;
+ $A = $B;
+ $B = ($2 =~ m|^</| ? 1 : 0);
+ $O .= &StripPlainText($B, $A, $L);
+ $O .= &StripHTMLTag($T);
}
- $O .= &StripPlainText($I);
+ $O .= &StripPlainText(0, $B, $I);
return $O;
}
--
Denis Barbier
WML Maintainer
______________________________________________________________________
Website META Language (WML) www.engelschall.com/sw/wml/
Official Support Mailing List sw-wml@engelschall.com
Automated List Manager majordomo@engelschall.com