html_safe
not working?
#171
-
I am trying to pass a raw HTML string as an argument like this: span " · ".html_safe but it gets escaped and the browser outputs it as is. Is this a bug, expected, or is there another way around this? |
Beta Was this translation helpful? Give feedback.
Answered by
joeldrapper
Sep 19, 2022
Replies: 1 comment 1 reply
-
Hey @cmer, you can get unescaped output using the span { raw " · " } I wanted to avoid using |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
cmer
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey @cmer, you can get unescaped output using the
raw
method. Sorry this isn’t documented at the moment.I wanted to avoid using
.html_safe
as it requires a String patch from Rails and it’s slower than passing the string to araw
method.