From 48466907fd952e835974978b033b4a5c45334c04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig-=C3=98rjan=20Smelror?= Date: Thu, 1 Feb 2024 15:15:36 +0100 Subject: [PATCH] _html: Refine python script --- qsgen2 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qsgen2 b/qsgen2 index ce7912a..7733d12 100755 --- a/qsgen2 +++ b/qsgen2 @@ -805,10 +805,10 @@ _html() { # Define the Python code for parsing and replacing specific QStags local python_code=$(cat <", "#EH1": "", @@ -875,10 +875,10 @@ def replace_qstags(match): "#EH5": "", "#EH6": "", } - return qstag_dict.get(qstag, qstag) # Replace or return unchanged # Define the regular expression pattern for QStags, excluding specific ones pattern = r'(?<=\s)(#(?!link|image|ytvideo|updated|version)\w+)' + # Replace QStags using the defined function result = re.sub(pattern, replace_qstags, '''$content''', flags=re.MULTILINE)