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

Unicode added in HREF / SRC link (only on Chrome) #6828

Closed
MimyyK opened this issue Oct 16, 2017 · 2 comments
Closed

Unicode added in HREF / SRC link (only on Chrome) #6828

MimyyK opened this issue Oct 16, 2017 · 2 comments

Comments

@MimyyK
Copy link

MimyyK commented Oct 16, 2017

Version

2.5.2

Reproduction link

https://codepen.io/MimyyMs/pen/Jrmgde

Steps to reproduce

Only on Chrome browser :

  1. Click the link or inspect the link HREF

What is expected?

No unicode in the HTML source.

On the other browsers (FireFox, IE, Edge, Safari) the link is not updated.

I have the same issue with <img src=""> and that broke my image.

What is actually happening?

The link in the HTML source is :

<a href="https://www.google.com/&#9;">My link 2</a>

VUEJS update my link and add a unicode in the HREF/SRC attributes and then broke the link.


I can resolve the issue with a correct link (without tab or line break) but without VUEJS I don't have this problem, link containing tab or line break is working as expected.
Either the tab and line break should be replaced in every browser or Chrome should not do it.

@phanan
Copy link
Member

phanan commented Oct 18, 2017

Either the tab and line break should be replaced in every browser or Chrome should not do it.

Or you can (and should) validate your data instead (like you said, "resolve the issue with a correct link"). I don't think Vue should tamper with your data (in this case, trimming the funny characters from the URL). In other words, this belongs in userland IMHO.

@dahrens
Copy link

dahrens commented Oct 20, 2017

@phanan in this case it seems that it actually does tamper. When you remove the initialization of vue in the codepen you'll not encounter the described behaviour.

It looks like an invalid html entity to me that is magically added at the end of the link.

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