Skip to content

Commit 4393acf

Browse files
committed
docs: about the new raw content feature
1 parent 07feafb commit 4393acf

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,21 @@ The HTML equivalent is:
106106
<script async src="js/script.js"></script>
107107
```
108108

109+
### Adding unescaped content
110+
This is useful when rendering HTML entities like `&copy;`.
111+
112+
``` python
113+
from python_hiccup.html import raw
114+
115+
data = ["div", raw("&copy; this should <strong>not</strong> be escaped!")]
116+
```
117+
118+
The HTML output:
119+
120+
``` html
121+
<div>&copy; this should <strong>not</strong> be escaped!</div>
122+
```
123+
109124
## Resources
110125
- [PyScript and python-hiccup example](https://pyscript.com/@davidvujic/pyscript-jokes-with-a-hiccup/latest?files=main.py) - PyScript Jokes with a Hiccup
111126
- [Hiccup](https://github.com/weavejester/hiccup) - the original implementation, for Clojure.

0 commit comments

Comments
 (0)