diff options
Diffstat (limited to 'lib/DBInfoscreen/Helper')
-rw-r--r-- | lib/DBInfoscreen/Helper/HAFAS.pm | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/DBInfoscreen/Helper/HAFAS.pm b/lib/DBInfoscreen/Helper/HAFAS.pm index 84e42c3..3faf3c7 100644 --- a/lib/DBInfoscreen/Helper/HAFAS.pm +++ b/lib/DBInfoscreen/Helper/HAFAS.pm @@ -121,10 +121,14 @@ sub get_xml_p { $body =~ s{P&R}{P&R}; $body =~ s{Wagen \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>[...]"> # (replace line breaks with space) |