html icon indicating copy to clipboard operation
html copied to clipboard

question: embedding raw html

Open fliepeltje opened this issue 1 year ago • 1 comments

Hey, I want to use this as the main driver for generating my html, but I also have some markdown-based content that needs to be rendered. I can render it fine to valid html, but I cannot really find how I would embed this within an existing element.

So I'd like something like:

use html::text_content::OrderedList;
let tree = OrderedList::builder()
    .raw_html(&my_content)
    .build();

Just wondering if this is not implemented or if it is and I just can't find it :)

fliepeltje avatar Dec 09 '23 17:12 fliepeltje

The .text() function allows you to put text into an element, which is not currently escaped. See https://github.com/yoshuawuyts/html/issues/12 for a discussion of whether it should be escaped.

calebeby avatar Apr 18 '24 00:04 calebeby