Skip to content

Conversation

@oscarotero
Copy link
Contributor

Sorry for this #2797
The problem was caused by this JSX code:

docs/_includes/doc.tsx

Lines 70 to 75 in 8707eef

<h1
dangerouslySetInnerHTML={{
__html: helpers.md(data.title!, true),
}}
>
</h1>

It works correctly when the jsx option is set to react-jsx. But in precompile mode, the element content is passed twice: once with the dangerouslySetInnerHTML attribute and again as the children property which is an empty string (I'm not sure if this is a bug of Deno or it's the expected behavior).

I fixed it in the JSX library by concatenating the content instead of replacing it (here), and it works fine now.

BTW, instead of using the dangerouslySetInnerHTML attribute, in Lume it's possible to use the children directly, which is cleaner:

<h1>
{{ __html: helpers.md(data.title!, true) }}
</h1>

@thisisjofrank thisisjofrank merged commit 10c7384 into denoland:main Dec 26, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants