diff options
author | Daniel Friesel <derf@finalrewind.org> | 2021-06-05 14:17:49 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2021-06-05 14:17:49 +0200 |
commit | 9221ddce85fadf1ae98530b524ae81ab726d133e (patch) | |
tree | 3eee37754ef2936d7e01bbe67c2d773142c0a809 /lib/Travelynx | |
parent | 16c1d12373c5e69efc92a11d0b71ef0d41f29572 (diff) |
HAFAS: Work around yet another case of invalid XML
Diffstat (limited to 'lib/Travelynx')
-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 |