summaryrefslogtreecommitdiff
path: root/lib/DBInfoscreen/Helper/HAFAS.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/DBInfoscreen/Helper/HAFAS.pm')
-rw-r--r--lib/DBInfoscreen/Helper/HAFAS.pm13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/DBInfoscreen/Helper/HAFAS.pm b/lib/DBInfoscreen/Helper/HAFAS.pm
index 0a98e73..84e42c3 100644
--- a/lib/DBInfoscreen/Helper/HAFAS.pm
+++ b/lib/DBInfoscreen/Helper/HAFAS.pm
@@ -126,9 +126,18 @@ sub get_xml_p {
$body
=~ s{<Attribute([^>]+)text="([^"]*)"([^"=]*)""}{<Attribute$1text="$2&#042;$3&#042;"}s;
- # Dito for <HIMMessage [...] lead="[...]<br>[...]">.
+ # Dito for <HIMMessage [...] lead="[...]<br>[...]">
+ # (replace line breaks with space)
while ( $body
- =~ s{<HIMMessage([^>]+)lead="([^"]*)<br/?>([^"=]*)"}{<HIMMessage$1lead="$2 $3"}gs
+ =~ s{<HIMMessage([^>]+)lead="([^"]*)<br/?>([^"=]*)"}{<HIMMessage$1lead="$2 $3"}gis
+ )
+ {
+ }
+
+ # ... and any other HTML tag inside an XML attribute
+ # (remove them entirely)
+ while ( $body
+ =~ s{<HIMMessage([^>]+)lead="([^"]*)<[^>]+>([^"=]*)"}{<HIMMessage$1lead="$2$3"}gis
)
{
}