set-alias-page.py: prevent synchronizing alias pages that are non-standard (#19859)

This commit is contained in:
Managor
2025-12-09 23:09:04 +02:00
committed by GitHub
parent 28b53a262b
commit e35330857b
+9
View File
@@ -269,6 +269,15 @@ def get_alias_command_in_page(path: Path, alias_pattern: str) -> AliasPageConten
if len(command_lines) != 2 or not title:
return AliasPageContent(title="", original_command="", documentation_command="")
stripped_template = config.templates["en"].replace("example", "")
stripped_en = content
stripped_en = re.sub(r"#.*", "# ", stripped_en)
stripped_en = re.sub(r"`(?!tldr).*`", "``", stripped_en)
stripped_en = re.sub(r"`tldr .*`", "`tldr `", stripped_en)
if stripped_template != stripped_en:
return AliasPageContent(title="", original_command="", documentation_command="")
original_command = ""
documentation_command = ""