mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 17:20:45 +00:00
fix: narrow Mintlify accordion guard
This commit is contained in:
@@ -140,17 +140,27 @@ function checkMintlifyMdxStructure(filePath, raw) {
|
||||
accordionStack.push({
|
||||
indent: openAccordion[1].length,
|
||||
line: index + 1,
|
||||
hasOutdentedListItem: false,
|
||||
});
|
||||
continue;
|
||||
}
|
||||
|
||||
const listItem = line.match(/^(\s*)[-*+]\s+/u);
|
||||
if (listItem) {
|
||||
for (const accordion of accordionStack) {
|
||||
if (listItem[1].length < accordion.indent) {
|
||||
accordion.hasOutdentedListItem = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const closeAccordion = line.match(/^(\s*)<\/Accordion>/u);
|
||||
if (!closeAccordion) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const opening = accordionStack.pop();
|
||||
if (opening && closeAccordion[1].length > opening.indent) {
|
||||
if (opening && opening.hasOutdentedListItem && closeAccordion[1].length > opening.indent) {
|
||||
errors.push({
|
||||
type: "mintlify-mdx",
|
||||
file: filePath,
|
||||
|
||||
Reference in New Issue
Block a user