- Add fix-05_empty.patch, see https://github.com/tokuhirom/HTML-TreeBuilder-LibXML/pull/17 OBS-URL: https://build.opensuse.org/request/show/1103154 OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-HTML-TreeBuilder-LibXML?expand=0&rev=6
25 lines
838 B
Diff
25 lines
838 B
Diff
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
|
|
|
|
---
|
|
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;
|
|
}
|
|
}
|
|
|