Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

help-beta: Convert file includes that don't occupy their own lines.

Shubham Padia8f51b9322398
diff --git a/tools/convert-help-center-docs-to-mdx b/tools/convert-help-center-docs-to-mdx
index b77a8bdfa95..024d0188584 100755
--- a/tools/convert-help-center-docs-to-mdx
+++ b/tools/convert-help-center-docs-to-mdx
@@ -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)