mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
help-beta: Convert file includes that don't occupy their own lines.
The regex we were using for file includes was searching for the syntax at the start of a line but the file includes can be followed by a `- ` as part of a list item, due to which 15 occurences of includes were not being converted. This commit fixes that.
This commit is contained in:
committed by
Tim Abbott
parent
896fc5e8b6
commit
8f51b93223
@@ -122,9 +122,11 @@ def fix_file_imports(
|
||||
return convert_kebab_to_pascal(os.path.basename(match_string).split(".")[0])
|
||||
|
||||
def convert_to_astro_tag(match: re.Match[str]) -> str:
|
||||
return "<" + get_pascal_filename_without_extension(match.group(1)) + " />"
|
||||
# The space before < makes sure that the component is interpreted correctly
|
||||
# when it is not occupying it's own line, e.g. it is part of a list item.
|
||||
return " <" + get_pascal_filename_without_extension(match.group(1)) + " />"
|
||||
|
||||
RE = re.compile(r"^ {,3}\{!([^!]+)!\} *$", re.MULTILINE)
|
||||
RE = re.compile(r" {,3}\{!([^!]+)!\} *$", re.MULTILINE)
|
||||
result = RE.sub(convert_to_astro_tag, markdown_string)
|
||||
matches = RE.findall(markdown_string)
|
||||
|
||||
|
Reference in New Issue
Block a user