Skip to content

How to inject reactive components into static HTML content #2385

Closed Answered by jsimonrichard
jsimonrichard asked this question in Q&A
Discussion options

You must be logged in to vote

I'm over thinking this. If save the string with this format:

`export default Content() {
    return (
        ${escapedHTMLFromAsciiDoc}
    )
}`

...to a temp file, and then load it directly using await import(tmpFile), it should work.

Maybe not the prettiest solution, but I don't need pretty.

If you don't the asciidoc file (I don't), you would have to be very careful with how you escape the html content, since with SSR it's running on the server.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@jsimonrichard
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by jsimonrichard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants