fix: narrow Mintlify accordion guard · openclaw/openclaw@95448d2
steipete
·
2026-04-24
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -140,17 +140,27 @@ function checkMintlifyMdxStructure(filePath, raw) {
|
140 | 140 | accordionStack.push({ |
141 | 141 | indent: openAccordion[1].length, |
142 | 142 | line: index + 1, |
| 143 | +hasOutdentedListItem: false, |
143 | 144 | }); |
144 | 145 | continue; |
145 | 146 | } |
146 | 147 | |
| 148 | +const listItem = line.match(/^(\s*)[-*+]\s+/u); |
| 149 | +if (listItem) { |
| 150 | +for (const accordion of accordionStack) { |
| 151 | +if (listItem[1].length < accordion.indent) { |
| 152 | +accordion.hasOutdentedListItem = true; |
| 153 | +} |
| 154 | +} |
| 155 | +} |
| 156 | + |
147 | 157 | const closeAccordion = line.match(/^(\s*)<\/Accordion>/u); |
148 | 158 | if (!closeAccordion) { |
149 | 159 | continue; |
150 | 160 | } |
151 | 161 | |
152 | 162 | const opening = accordionStack.pop(); |
153 | | -if (opening && closeAccordion[1].length > opening.indent) { |
| 163 | +if (opening && opening.hasOutdentedListItem && closeAccordion[1].length > opening.indent) { |
154 | 164 | errors.push({ |
155 | 165 | type: "mintlify-mdx", |
156 | 166 | file: filePath, |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。