Skip Menu |

This queue is for tickets about the XML-SemanticDiff CPAN distribution.

Report information
The Basics
Id: 128054
Status: new
Priority: 0/
Queue: XML-SemanticDiff

People
Owner: Nobody in particular
Requestors: TPLA [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Request: make whitespace handling configureable
Consider these two cases involving significant whitespace in mixed content: OLD: <p>Space in mixed content before<i>inline element</i>and after.</p> NEW: <p>Space in mixed content before <i>inline element</i> and after.</p> Clearly, whitespace makes a difference. Currently, this difference isn't detected as whitespace is folded by default. I suggest making whitespace handling subject to an optional parameter ("foldwhitespace") and additionally assume the default to be "off": sub Text { my $self = shift; my $expat = shift; my $element = $expat->current_element; my $char = $_; if($self->opts()->{foldwhitespace}) { $char =~ s/^\s*//; $char =~ s/\s*$//; $char =~ s/\s+/ /g; } # We should add any character that isn't undef, so check # for defined here instead of checking if the value is true $self->char_accumulator()->{$element} .= $char if defined($char); }
Ahh, RT autoescapes HTML. Samples again for clarity: OLD: <p>Space in mixed content before<i>inline element</i>and after.</p> NEW: <p>Space in mixed content before <i>inline element</i> and after.</p>