mirror of
https://github.com/tldr-pages/tldr
synced 2026-08-26 14:13:36 +01:00
scripts/set-alias-page.py: fix "page updated" spam when it wasn't being updated (#19941)
This commit is contained in:
@@ -269,14 +269,19 @@ 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 alias_pattern == get_locale_alias_pattern("en"):
|
||||
stripped_template = config.templates["en"]
|
||||
stripped_template = stripped_template.replace("example", "")
|
||||
|
||||
if stripped_template != stripped_en:
|
||||
return AliasPageContent(title="", original_command="", documentation_command="")
|
||||
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 = ""
|
||||
|
||||
Reference in New Issue
Block a user