fix: Relax isCodeBlock check for nested code elements

Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
2025-12-03 02:37:58 +00:00
parent 762e8a9a2e
commit 504fe745ea

View File

@@ -58,7 +58,7 @@ function Article({ cache }) {
}; };
const isCodeBlock = (v) => { const isCodeBlock = (v) => {
return v.localName === 'pre' || v.localName === 'code' || (v.children?.length === 1 && v.children[0].localName === 'code'); return v.localName === 'pre' || v.localName === 'code' || (v.firstElementChild && v.firstElementChild.localName === 'code');
}; };
const nodes = (s) => { const nodes = (s) => {