summaryrefslogtreecommitdiff
path: root/lib/Travelynx/Helper/HAFAS.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Travelynx/Helper/HAFAS.pm')
-rw-r--r--lib/Travelynx/Helper/HAFAS.pm8
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&#042;$3&#042;"}s;
+ =~ s{<Attribute([^>]+)text="([^"]*)"([^"=>]*)""}{<Attribute$1text="$2&#042;$3&#042;"}s;
+
+ # Same for <HIMMessage lead="[...]"[...]"[...]" />
+ $body
+ =~ s{<HIMMessage([^>]+)lead="([^"]*)"([^"=>]*)"([^"]*)"}{<Attribute$1text="$2&#042;$3&#042;$4"}s;
# Dito for <HIMMessage [...] lead="[...]<br>[...]">.
while ( $body