isnt rendering in htm
- Lingua principale
- JavaScript
- Stelle
- 9k
- Fork
- 181
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
When I have ` ` in htm, it's outputting as literally ` ` in the html.
I've seen some [similar questions for JSX](https://stackoverflow.com/questions/37909134/nbsp-jsx-not-working), but it seems that, even there, the space should render.
Is HTM's not rendering it as a non-breaking space intentional?
Here's a near-simplest case reproduction. Obviously the key is ``render(html`# #`, document.getElementById('root-element'));``. It comes out without a space.
```
Hello, Preact World!
window.render = window.preact.render;
window.html = window.htmPreact.html;
document.addEventListener('DOMContentLoaded', function () {
render(html`# #`, document.getElementById('root-element'));
});
```

(Strangely, if I click "edit html" in Chrome (well, here, Brave), it shows that starts with `&` so, for whatever reason, that `&` is a literal `&` in the render..)

Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Start with the standalone browser reproduction using render(html`# #`, document.getElementById('root-element')) and the htmPreact.html entry point shown in the issue. Check how the template output reaches the rendered HTML and compare it with the expected non-breaking space behavior. Done means the reproduction displays a non-breaking space rather than the literal entity.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- javascript
- Ambito
- frontend
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 35/100