how do i add an ` ` into an element? it k...
# javascript
m
how do i add an
 
into an element? it keeps appearing as normal text😞
s
Does it not have an effect? It is a space after all
m
it just says
 
, i want it to display as a space
s
Maybe use kotlins
Typography.nbsp
instead
m
i found the solution
Copy code
div {
  attrs.unsafe {
    +Entities.nbsp.text
  }
}
s
Doesnt
div { +Entities.nbsp }
work also ?
m
nope, nbsp is an enum, if you do
Copy code
div {
  +Entities.nbsp.text
}
you'll see:
 
instead of
s
Weird. My example works in my version of kotlinx.html
f
Michael probably uses React, and it escapes special chars like
&
m
yeah, I'm using create-react-kotlin-app
i keep forgetting that I'm jsxing and not htmling