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: Flatten only in case of matching tagName.

Shubham Padia429bbae77ce7
diff --git a/help-beta/src/components/FlattenList.astro b/help-beta/src/components/FlattenList.astro
index 586e91cc3e2..5e7619995bf 100644
--- a/help-beta/src/components/FlattenList.astro
+++ b/help-beta/src/components/FlattenList.astro
@@ -26,12 +26,15 @@ const flattened = {
if (other.type === "comment") {
return [];
}
- assert.ok(
- other.type === "element" &&
- (other.tagName === first_element.tagName ||
- other.tagName === "aside"),
- );
- return other.children;
+ assert.ok(other.type === "element");
+ // Flatten only in case of matching tagName, for the rest, we
+ // return the elements without flattening since asides, code
+ // blocks and other elements can be part of a single list item
+ // and we do not want to flatten them.
+ if (other.tagName === first_element.tagName) {
+ return other.children;
+ }
+ return [other];
}),
};
---