scripts/flatpak: Escape XML characters in convert-release-notes.py (#13801)
Resolves #13791 Release Notes: - N/A
This commit is contained in:
parent
c617d48e16
commit
d3f869acd8
1 changed files with 4 additions and 4 deletions
|
@ -1,18 +1,18 @@
|
||||||
|
import os
|
||||||
import re
|
import re
|
||||||
import requests
|
import requests
|
||||||
import sys
|
import sys
|
||||||
import textwrap
|
import textwrap
|
||||||
import os
|
|
||||||
|
from html import escape
|
||||||
|
|
||||||
def clean_line(line: str, in_code_fence: bool) -> str:
|
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)
|
||||||
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:
|
if not in_code_fence:
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
|
|
||||||
return line
|
return escape(line)
|
||||||
|
|
||||||
|
|
||||||
def convert_body(body: str) -> str:
|
def convert_body(body: str) -> str:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue