forked from tanner/qotnews
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:
@@ -58,7 +58,7 @@ function Article({ cache }) {
|
||||
};
|
||||
|
||||
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) => {
|
||||
|
||||
Reference in New Issue
Block a user