HAFAS: Handle <br> tags in HTML attributes
This commit is contained in:
parent
93ca0e6e75
commit
5b1841ccce
1 changed files with 5 additions and 0 deletions
|
@ -201,6 +201,11 @@ sub get_xml_p {
|
||||||
# Work around it.
|
# Work around it.
|
||||||
$body
|
$body
|
||||||
=~ s{<Attribute([^>]+)text="([^"]*)"([^"=]*)""}{<Attribute$1text="$2*$3*"}s;
|
=~ s{<Attribute([^>]+)text="([^"]*)"([^"=]*)""}{<Attribute$1text="$2*$3*"}s;
|
||||||
|
|
||||||
|
# Dito for <HIMMessage [...] lead="[...]<br>[...]">.
|
||||||
|
$body
|
||||||
|
=~ s{<HIMMessage([^>]+)lead="([^"]*)<br/?>([^"=]*)"}{<HIMMessage$1lead="$2 $3"}s;
|
||||||
|
|
||||||
eval { $tree = XML::LibXML->load_xml( string => $body ) };
|
eval { $tree = XML::LibXML->load_xml( string => $body ) };
|
||||||
if ( my $err = $@ ) {
|
if ( my $err = $@ ) {
|
||||||
if ( $err =~ m{extra content at the end}i ) {
|
if ( $err =~ m{extra content at the end}i ) {
|
||||||
|
|
Loading…
Reference in a new issue