Merge pull request #483 from Rust1667/patch-4

fix script regex
This commit is contained in:
nbats 2023-04-07 05:25:55 -07:00 committed by GitHub
commit cbe59be90f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -74,7 +74,7 @@ def replace_domain_and_page(text):
return text return text
def replace_underscore_in_subsections(text): def replace_underscore_in_subsections(text):
pattern = r'(/#[\w]+(?:_[\w]+)*)' pattern = r'(/#[\w\-]+(?:_[\w]+)*)'
matches = re.findall(pattern, text) matches = re.findall(pattern, text)
for match in matches: for match in matches:
replacement = match.replace('_', '-') replacement = match.replace('_', '-')