fix: Detect code blocks nested in pre tags for conversion

Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
2025-12-03 01:43:33 +00:00
parent a2303841ec
commit da108f25d4

View File

@@ -105,7 +105,7 @@ function Article({ cache }) {
:
<React.Fragment key={k}>
<v.localName dangerouslySetInnerHTML={v.innerHTML ? { __html: v.innerHTML } : null} />
{(v.localName === 'pre' || v.localName === 'code') && <button onClick={() => pConvert(k)}>Convert Code to Paragraph</button>}
{(v.localName === 'pre' || v.localName === 'code' || (v.children?.length === 1 && v.children[0].localName === 'code')) && <button onClick={() => pConvert(k)}>Convert Code to Paragraph</button>}
</React.Fragment>
)
)}