Reformat code examples for using an entity

This commit is contained in:
Daniel Compton 2019-12-28 09:43:50 +13:00 committed by GitHub
parent 6615b535c4
commit 956f4dc1dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -6,7 +6,7 @@ How can I use an entity like "nbsp"?
If you try to do this:
```clj
[:div "hello" "&nbsp;" "there"] ;; <--- note: attempt to use an entity
[:div "hello" "&nbsp;" "there"] ;; <--- note: attempt to use an entity
```
then you will see the string for the entity. Which is not what you want.
@ -21,7 +21,7 @@ Instead you should do this:
2. Use it like this ...
```clj
[:div "hello" (gstring/unescapeEntities "&nbsp;") "there"]
[:div "hello" (gstring/unescapeEntities "&nbsp;") "there"]
```
**Note:** `unescapeEntities` relies on the DOM to produce a string with unescape entities;