diff options
-rw-r--r-- | lib/Travelynx/Helper/HAFAS.pm | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Travelynx/Helper/HAFAS.pm b/lib/Travelynx/Helper/HAFAS.pm index a7c4abc..84226a4 100644 --- a/lib/Travelynx/Helper/HAFAS.pm +++ b/lib/Travelynx/Helper/HAFAS.pm @@ -198,10 +198,14 @@ sub get_xml_p { $body =~ s{Wagen \d+ \K&}{&}; $body =~ s{Wagen \d+, \d+ \K&}{&}; - # <Attribute [...] text="[...] "[...]"" /> is invalid XML. + # <Attribute [...] text="[...]"[...]"" /> is invalid XML. # Work around it. $body - =~ s{<Attribute([^>]+)text="([^"]*)"([^"=]*)""}{<Attribute$1text="$2*$3*"}s; + =~ s{<Attribute([^>]+)text="([^"]*)"([^"=>]*)""}{<Attribute$1text="$2*$3*"}s; + + # Same for <HIMMessage lead="[...]"[...]"[...]" /> + $body + =~ s{<HIMMessage([^>]+)lead="([^"]*)"([^"=>]*)"([^"]*)"}{<Attribute$1text="$2*$3*$4"}s; # Dito for <HIMMessage [...] lead="[...]<br>[...]">. while ( $body |