forked from tanner/qotnews
fix: Refine code block detection to exclude inline code
Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
@@ -60,7 +60,7 @@ function Article({ cache }) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const isCodeBlock = (v) => {
|
const isCodeBlock = (v) => {
|
||||||
return v.localName === 'pre' || v.localName === 'code' || (v.firstElementChild && v.firstElementChild.localName === 'code');
|
return v.localName === 'pre' || (v.localName === 'code' && !v.closest('p'));
|
||||||
};
|
};
|
||||||
|
|
||||||
const renderNodes = (nodes, keyPrefix = '') => {
|
const renderNodes = (nodes, keyPrefix = '') => {
|
||||||
|
|||||||
Reference in New Issue
Block a user