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

Possible bug in tooltip caption binding when content has escaped apostrophe #80

Open
simon-20 opened this issue Dec 12, 2015 · 1 comment

Comments

@simon-20
Copy link

Hi,

I've found a possible bug in the tooltip binding. If the title has an escaped apostrophe in its content, then calls to ko.applyBindings fail.

That is, something like the following fails:

<span class="fa fa-question-circle" data-bind="tooltip: { title: 'Hey, I&#x27;m a tooltip help string!', placement: 'top' }" aria-hidden="true"></span>

Swapping the quotes styles around fixes the issue, so this works:

<span class="fa fa-question-circle" data-bind='tooltip: { title: "Hey, I&#x27;m a tooltip help string!", placement: "top" }' aria-hidden="true"></span>

But it seems like the first version should work fine. There is a demo here:

http://simonkittle.com/dev/ko-bootstrap-binding-error/

It makes no difference whether the apostrophe is escaped with &#x27;, &#39; or &apos;.

@simon-20
Copy link
Author

I think perhaps this isn't a bug after all. According to the HTML 5 spec, any string values are permitted as values for HTML attributes, so the apostrophe should perhaps be escaped in the Javascript manner, \', rather than as an HTML entity (and ko-bs handles the former as expected).

(I came across this issue because ASP.NET's Razor uses HTML encoding, but I was able to work around that).

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

1 participant