From: Martin Pitt Date: Sat, 3 Jan 2026 16:43:31 +0000 (+0100) Subject: recipekeeper-split: Fix unescaped URLs X-Git-Url: https://piware.de/gitweb/?a=commitdiff_plain;h=af0dbf7671f2a183bd5895b024705850efa46bf1;p=bin.git recipekeeper-split: Fix unescaped URLs --- diff --git a/recipekeeper-split b/recipekeeper-split index a56f52e..c510408 100755 --- a/recipekeeper-split +++ b/recipekeeper-split @@ -33,6 +33,11 @@ content_fixed = re.sub(r'(]*)(?', r'\1 />', content) # Only match when the value is not already quoted content_fixed = re.sub(r'itemprop=([^\s">]+)', r'itemprop="\1"', content_fixed) +# 3. Fix unescaped ampersands in attribute values (& -> &) +# This handles ampersands in URLs and other attribute values +# Only escape & that are not already part of an entity +content_fixed = re.sub(r'&(?!amp;|lt;|gt;|quot;|apos;|#)', r'&', content_fixed) + # Parse as XML tree = ET.ElementTree(ET.fromstring(content_fixed)) root = tree.getroot()