From 646558af1321b9823fed90c72701728b1b87a27e Mon Sep 17 00:00:00 2001 From: Shubham Padia Date: Mon, 28 Jul 2025 16:21:04 +0000 Subject: [PATCH] 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. --- tools/convert-help-center-docs-to-mdx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tools/convert-help-center-docs-to-mdx b/tools/convert-help-center-docs-to-mdx index 84411a18d7..9d3cc769b5 100755 --- a/tools/convert-help-center-docs-to-mdx +++ b/tools/convert-help-center-docs-to-mdx @@ -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