mirror of
https://github.com/tldr-pages/tldr.git
synced 2026-08-28 11:25:16 +08:00
scripts/set-alias-page.py: adjust command line matching (#20849)
This commit is contained in:
@@ -236,7 +236,9 @@ def get_alias_command_in_page(path: Path, alias_pattern: str) -> AliasPageConten
|
||||
|
||||
title = next((line.strip("# \n") for line in lines if line.startswith("# ")), "")
|
||||
|
||||
command_lines = [line for line in lines if "`" in line]
|
||||
command_lines = [
|
||||
line for line in lines if line.startswith(("> " + alias_pattern, "`"))
|
||||
]
|
||||
|
||||
if len(command_lines) != 2 or not title:
|
||||
return AliasPageContent(title="", original_command="", documentation_command="")
|
||||
|
||||
Reference in New Issue
Block a user