Skip to content

Commit

Permalink
Allow for multi-option placeholders like in rsync.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Managor committed Dec 14, 2024
1 parent fb452eb commit 9926aff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tldr.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,9 +481,9 @@ def emphasise_example(x: str) -> str:
# Extract long or short options from placeholders
if not (shortform and longform):
if shortform:
line = re.sub(r'{{(-.)\|--[^|]+?}}', r'{{\1}}', line)
line = re.sub(r'{{(-[^|]+)\|--[^|]+?}}', r'{{\1}}', line)
elif longform:
line = re.sub(r'{{-.\|(--[^|]+?)}}', r'{{\1}}', line)
line = re.sub(r'{{-[^|]+\|(--[^|]+?)}}', r'{{\1}}', line)

elements = [' ' * 2 * LEADING_SPACES_NUM]
for item in COMMAND_SPLIT_REGEX.split(line):
Expand Down

0 comments on commit 9926aff

Please sign in to comment.