Skip to content
Snippets Groups Projects
Commit 344bdf6a authored by gregor herrmann's avatar gregor herrmann
Browse files

Add patch from upstream merge request: compatibility with newer libxml2.

Thanks: Paul Gevers for the bug report.
Closes: #995132
parent 1ff1e595
No related branches found
No related tags found
No related merge requests found
From d74d1f186b2e2c6334a78b895b0ea811a16617a4 Mon Sep 17 00:00:00 2001
From: Emmanuel Seyman <emmanuel@seyman.fr>
Date: Mon, 14 Jun 2021 21:12:07 +0200
Subject: [PATCH] fallback to toString() when toStringC14N(1) gives an empty
string
Bug: https://github.com/tokuhirom/HTML-TreeBuilder-LibXML/issues/16
Bug-Debian: https://bugs.debian.org/995132
---
lib/HTML/TreeBuilder/LibXML/Node.pm | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/HTML/TreeBuilder/LibXML/Node.pm b/lib/HTML/TreeBuilder/LibXML/Node.pm
index f3b4e81..b710dda 100644
--- a/lib/HTML/TreeBuilder/LibXML/Node.pm
+++ b/lib/HTML/TreeBuilder/LibXML/Node.pm
@@ -74,7 +74,8 @@ sub as_HTML {
{
local $@; # protect existing $@
my $output = eval { $_[0]->{node}->toStringC14N(1) };
- return $@ ? $_[0]->{node}->toString : $output;
+ return $_[0]->{node}->toString if ($@ or $output eq '');
+ return $output;
}
}
libxml2_2.9.12.patch
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment