Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v-html not work in svg text tag on ios8.4 safari #5310

Closed
jinphen opened this issue Mar 29, 2017 · 2 comments
Closed

v-html not work in svg text tag on ios8.4 safari #5310

jinphen opened this issue Mar 29, 2017 · 2 comments

Comments

@jinphen
Copy link

jinphen commented Mar 29, 2017

Version

2.1.8

Reproduction link

https://jsfiddle.net/czm8m265/

Steps to reproduce

use ios8.4 safari open the jsfiddle https://jsfiddle.net/czm8m265/

What is expected?

v-html rending the message

What is actually happening?

v-html not rending the message

@yyx990803
Copy link
Member

Technically SVG is not HTML, it's only embedded inside HTML. Per the specs SVG doesn't actually support innerHTML - it works in some browsers (like desktop Chrome), but not all. I'd suggest avoid using v-html with SVG.

@dhavyd
Copy link

dhavyd commented Sep 26, 2017

Hi! Thanks for this answer. I've running on the same problem, but on Microsoft Edge... What do you suggest if a need to create an SVG in "realtime" through VueJS, and then bind som HTML to it?

Ex:
myVar = '20:00  Some title'
<svg>
<text>{{myVar}}</text>
</svg>

As it is today, &nbsp; will be escaped and visible in the page.

Since innerHtml isn't a part of SVG specs, as you pointed out, I'm forced to use brackets to insert my value. If it's possible to "turn off" the HTML escaping in some contexts, it should solve this issue. Is there a way to do that or what do you suggest I should do?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants