summaryrefslogtreecommitdiff
path: root/lib/Travelynx/Helper/HAFAS.pm
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-02-06 12:13:25 +0100
committerDaniel Friesel <derf@finalrewind.org>2021-02-06 12:13:25 +0100
commit5b1841cccefc74b8fa3b523b3a5b5359a9e39c6d (patch)
treef66f0d53099176ad947b28abdbb38b64636718d8 /lib/Travelynx/Helper/HAFAS.pm
parent93ca0e6e75fe5914731970c4f54dc925187487e4 (diff)
HAFAS: Handle <br> tags in HTML attributes
Diffstat (limited to 'lib/Travelynx/Helper/HAFAS.pm')
-rw-r--r--lib/Travelynx/Helper/HAFAS.pm5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Travelynx/Helper/HAFAS.pm b/lib/Travelynx/Helper/HAFAS.pm
index bf51efd..77bd52b 100644
--- a/lib/Travelynx/Helper/HAFAS.pm
+++ b/lib/Travelynx/Helper/HAFAS.pm
@@ -201,6 +201,11 @@ sub get_xml_p {
# Work around it.
$body
=~ s{<Attribute([^>]+)text="([^"]*)"([^"=]*)""}{<Attribute$1text="$2&#042;$3&#042;"}s;
+
+ # Dito for <HIMMessage [...] lead="[...]<br>[...]">.
+ $body
+ =~ s{<HIMMessage([^>]+)lead="([^"]*)<br/?>([^"=]*)"}{<HIMMessage$1lead="$2 $3"}s;
+
eval { $tree = XML::LibXML->load_xml( string => $body ) };
if ( my $err = $@ ) {
if ( $err =~ m{extra content at the end}i ) {