mirror of
https://github.com/fmhy/edit.git
synced 2026-02-04 18:21:07 +11:00
fix script regex
it was giving some links with errors in the subsection like these: https://fmhy.pages.dev/storage/#drive-formatting--file_deletion https://fmhy.pages.dev/storage/#ip--dns_leak_tests and a bunch more, not replacing every underscore
This commit is contained in:
parent
472aeffa04
commit
5589e0effb
1 changed files with 1 additions and 1 deletions
|
|
@ -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('_', '-')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue