mirror of
https://github.com/matrix-org/matrix-spec
synced 2026-03-17 08:54:09 +01:00
Apply suggestions from code review
This commit is contained in:
parent
a23985296e
commit
cb00d2c566
|
|
@ -45,7 +45,8 @@ api_dir = os.path.join(os.path.dirname(scripts_dir), "data", "api")
|
||||||
#
|
#
|
||||||
# With:
|
# With:
|
||||||
#
|
#
|
||||||
# * <name of shortcode>: any word character and `-` and `/`.
|
# * <name of shortcode>: any word character and `-` and `/`. `re.ASCII` is used to only match
|
||||||
|
# ASCII characters in the name.
|
||||||
# * <list of parameters>: any character except `}`, must not start or end with a
|
# * <list of parameters>: any character except `}`, must not start or end with a
|
||||||
# whitespace.
|
# whitespace.
|
||||||
shortcode_regex = re.compile(r"""\{\{\% # {{%
|
shortcode_regex = re.compile(r"""\{\{\% # {{%
|
||||||
|
|
@ -83,6 +84,8 @@ def replace_shortcode(shortcode):
|
||||||
|
|
||||||
* boxes/note, boxes/rationale, boxes/warning
|
* boxes/note, boxes/rationale, boxes/warning
|
||||||
* added-in, changed-in
|
* added-in, changed-in
|
||||||
|
|
||||||
|
All closing tags (`{{ /shortcode }}`) are replaced with the empty string.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if shortcode['name'].startswith("/"):
|
if shortcode['name'].startswith("/"):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue