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

Strip tags from window title when opening in new window #203

Merged
merged 2 commits into from Jun 28, 2016

Conversation

@adrianbj
Copy link
Contributor

adrianbj commented Jun 22, 2016

No description provided.

@JanTvrdik

This comment has been minimized.

Copy link
Contributor

JanTvrdik commented Jun 23, 2016

Why not just use textContent instead of innerHtml?

@adrianbj

This comment has been minimized.

Copy link
Contributor Author

adrianbj commented Jun 23, 2016

Why not just use textContent instead of innerHtml?

It might be totally fine. I have just read several things on the browser inconsistencies with textContent so thought that a regex replace would be safer.

http://perfectionkills.com/the-poor-misunderstood-innerText/
http://clubajax.org/plain-text-vs-innertext-vs-textcontent/

In particular the line break discrepancies. It probably won't be an issue in this use case, but you can never be certain what a panel author may put inside the h1 tags.

@dg

This comment has been minimized.

Copy link
Member

dg commented Jun 26, 2016

Problem with regexp is that it is not safe, ie. <span title=">"> will not be stripped correctly.

Whitespace inside <title> is compessed, so textcontent should be fine.

@dg dg merged commit 841aff7 into nette:master Jun 28, 2016
2 checks passed
2 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@dg

This comment has been minimized.

Copy link
Member

dg commented Jun 28, 2016

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.