Make the regex for commenting settings more robust

This commit is contained in:
Kovid Goyal 2021-08-11 08:46:42 +05:30
parent b25ea9c863
commit 15e0b42f04
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -67,7 +67,7 @@ mark2_background
mark3_foreground
mark3_background
'''.splitlines()))
pat = f'^({"|".join(color_conf_items)})'
pat = fr'^\s*({"|".join(color_conf_items)})\b'
return re.sub(pat, r'# \1', nraw, flags=re.MULTILINE)