From d3f869acd82caa6b894768f1a3f0bf51befbd127 Mon Sep 17 00:00:00 2001 From: Joey Riches Date: Mon, 8 Jul 2024 16:25:17 +0100 Subject: [PATCH] scripts/flatpak: Escape XML characters in convert-release-notes.py (#13801) Resolves #13791 Release Notes: - N/A --- script/flatpak/convert-release-notes.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/script/flatpak/convert-release-notes.py b/script/flatpak/convert-release-notes.py index 49d57a2286..2c29cbacbf 100644 --- a/script/flatpak/convert-release-notes.py +++ b/script/flatpak/convert-release-notes.py @@ -1,18 +1,18 @@ +import os import re import requests import sys import textwrap -import os + +from html import escape def clean_line(line: str, in_code_fence: bool) -> str: - line = re.sub(r"<", "<", line) - line = re.sub(r">", ">", line) line = re.sub(r"\(\[(#\d+)\]\([\w|\d\:|\/|\.|\-|_]*\)\)", lambda match: f"[{match.group(1)}]", line) line = re.sub(r"\[(#\d+)\]\([\w|\d\:|\/|\.|\-|_]*\)", lambda match: f"[{match.group(1)}]", line) if not in_code_fence: line = line.strip() - return line + return escape(line) def convert_body(body: str) -> str: