Knio / dominate

Dominate is a Python library for creating and manipulating HTML documents using an elegant DOM API. It allows you to write HTML pages in pure Python very concisely, which eliminate the need to learn another template language, and to take advantage of the more powerful features of Python.
GNU Lesser General Public License v3.0
1.72k stars 108 forks source link

Unable to insert raw div #115

Closed krav4 closed 5 years ago

krav4 commented 5 years ago

I have a use case where I want to insert the output of plotly plot() function, but div() tag changes all < and > to &lt and &gt, which makes rendering that div impossible. I would like to be able to insert raw div tag without it being reformatted

Knio commented 5 years ago

This is by design, to prevent XSS attacks. To bypass this for trusted data, us the util.raw function.

https://github.com/Knio/dominate#embedding-html