mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-09 15:08:13 +02:00
Also prevent unknown roles from causing formatting to error
This commit is contained in:
@@ -204,7 +204,10 @@ def prettify(text: str) -> str:
|
||||
|
||||
def sub(m: Match) -> str:
|
||||
role, text = m.group(1, 2)
|
||||
return str(role_map[role](text))
|
||||
try:
|
||||
return str(role_map[role](text))
|
||||
except KeyError:
|
||||
return str(text)
|
||||
|
||||
text = re.sub(r':([a-z]+):`([^`]+)`', sub, text)
|
||||
return text
|
||||
|
||||
Reference in New Issue
Block a user