mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 21:13:36 +00:00
help-beta: Check for nested ordered list for flatten list conversion.
We had some include files that started with another include, and in some cases this nested included file was also `only` an ordered list. In that case, we need to add a flattenlist around the file, but our current conversion script was not accounting for that.
This commit is contained in:
committed by
Tim Abbott
parent
4b9a8d8fa7
commit
646558af13
@@ -621,6 +621,17 @@ def get_include_files_info(include_input_dir: str) -> dict[str, IncludeFileInfo]
|
||||
include_files_info[name] = {
|
||||
"is_only_ordered_list": is_include_only_ordered_list(markdown_string)
|
||||
}
|
||||
# We are just checking one level deep and not checking for
|
||||
# any recursions, which would be fine for our use case.
|
||||
if markdown_string.startswith("{!"):
|
||||
nested_file_name = (
|
||||
markdown_string.splitlines()[0].strip().replace("{!", "").replace("!}", "")
|
||||
)
|
||||
nested_file_path = os.path.join(include_input_dir, nested_file_name)
|
||||
nested_markdown_string = get_markdown_string_from_file(nested_file_path)
|
||||
include_files_info[name] = {
|
||||
"is_only_ordered_list": is_include_only_ordered_list(nested_markdown_string)
|
||||
}
|
||||
|
||||
return include_files_info
|
||||
|
||||
|
||||
Reference in New Issue
Block a user