Html entities are automatically escaped
See original GitHub issueIt seems that Vue.js templating language auto-escape strings. I made a filter that wrap urls to links, but the printed results is escaped html.
I couldn’t find any mention of this in the docs.
Is there a way to avoid escaping? Should’nt it be a filter instead? Like this:
<p>{{ unsafe_string | escape }}</p>
Issue Analytics
- State:
- Created 9 years ago
- Comments:11 (2 by maintainers)
Top Results From Across the Web
Fastest method to escape HTML tags as HTML entities?
Here's one way you can do this: var escape = document.createElement('textarea'); function escapeHTML(html) { escape.textContent = html; return escape.
Read more >HTML Escape Characters: Complete List of HTML Entities
Number Symbol Entity Name Code Description
9 Tab &Tab 	 Tab
10 New Line &NewLine 
 New Line
32 Space     Space
Read more >Using character escapes in markup and CSS - W3C
Character escapes are a way of writing a character in markup using only ASCII code points. They are useful if you are unable...
Read more >Should I escape the Apostrophe ( ' ) character with its HTML ...
It's less obvious, but it's actually important to escape " . If a string ever ends up in a HTML attribute ( title="something"...
Read more >How to escape & unescape HTML characters in string in ...
Escaping HTML characters in a string means replacing the: ... We can escape the HTML of the string using the replace method of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@InstanceOfMichael This answer was only for Vue 1.x. But if you are using Vue 2.x, you should use computed properties to apply filters combined with
v-html
.http://vuejs.org/guide/syntax.html#Raw-HTML
You can use
{{{ unsafe_string }}}
for raw html. (docs here: http://vuejs.org/guide/#Mustache_Bindings in the third note box)