diff --git a/scripts/set-alias-page.py b/scripts/set-alias-page.py index f3e7e3b455..884d7da79e 100755 --- a/scripts/set-alias-page.py +++ b/scripts/set-alias-page.py @@ -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 = ""