From: Renan Rodrigo <renanrodrigo@canonical.com>
Date: Thu, 7 Aug 2025 00:01:52 -0300
Subject: Fix sanitizer function for libxml2 >= 2.14 and HTML5

This is adapting the sanitize function to remove commented XML tags from
the resulting markdown.
Fixes: #263

Origin: vendor, https://github.com/renanrodrigo/html-to-markdown/commit/66416e08a2314c2e8797741ffe30a9bd7085cd75
Bug: https://github.com/thephpleague/html-to-markdown/issues/263
Bug-Debian: https://bugs.debian.org/1107544
---
 src/HtmlConverter.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/HtmlConverter.php b/src/HtmlConverter.php
index 944cb08..20a994d 100644
--- a/src/HtmlConverter.php
+++ b/src/HtmlConverter.php
@@ -233,7 +233,7 @@ class HtmlConverter implements HtmlConverterInterface
          * Removing unwanted tags. Tags should be added to the array in the order they are expected.
          * XML, html and body opening tags should be in that order. Same case with closing tags
          */
-        $unwanted = ['<?xml encoding="UTF-8">', '<html>', '</html>', '<body>', '</body>', '<head>', '</head>', '&#xD;'];
+        $unwanted = ['<?xml encoding="UTF-8">', '<!--?xml encoding="UTF-8"-->', '<html>', '</html>', '<body>', '<!--?xml encoding="UTF-8"-->', '</body>', '<head>', '</head>', '&#xD;'];
 
         foreach ($unwanted as $tag) {
             if (\strpos($tag, '/') === false) {
