From e9a6804c98f4954a70640d826864a209594b4a83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig-=C3=98rjan=20Smelror?= Date: Thu, 1 Feb 2024 13:45:13 +0100 Subject: [PATCH] _html: Refine python script --- qsgen2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qsgen2 b/qsgen2 index 7b6157a..ec90daa 100755 --- a/qsgen2 +++ b/qsgen2 @@ -878,7 +878,7 @@ def replace_qstags(match): return qstag_dict.get(qstag, qstag) # Replace or return unchanged # Define the regular expression pattern for QStags -pattern = r'#(?!link|image|ytvideo|updated|version)\w+' +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)