Saving and inserting texts for a website (like a blog) #3749
-
Hi everyone!
but this does not look like the best practice, does it? I could imagine for example writing the essays themselves in Markdown files, then using comrak to convert it to html, but I cannot find a good way to bind straight html into the layout, which is made with the Could someone give me an idea, and provide an example, please? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
You can try something like https://github.com/wheregmis/wheregmis.github.io/blob/master/src/components/markdown.rs Converting markdown to html and putting it inside dangerous_inner_html |
Beta Was this translation helpful? Give feedback.
-
Thanks! That definitely looks like an option. Is there any better option, I mean something that does not perform potentially dangerous operations that expose to XSS attacks? Is there any best practice in this regard? |
Beta Was this translation helpful? Give feedback.
You can try something like https://github.com/wheregmis/wheregmis.github.io/blob/master/src/components/markdown.rs
Converting markdown to html and putting it inside dangerous_inner_html