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

Encoded HTML in <optgroups> renders html #1348

Closed
ashleydw opened this issue Mar 31, 2016 · 1 comment
Closed

Encoded HTML in <optgroups> renders html #1348

ashleydw opened this issue Mar 31, 2016 · 1 comment

Comments

@ashleydw
Copy link

optiongrp labels with encoded html get rendered as html, rather than their the text that should be displayed. <options> themselves work correctly.

I think this is down to the this.parentNode.label call: https://github.com/silviomoreto/bootstrap-select/blob/master/js/bootstrap-select.js#L587

Is there anyway to avoid this? It makes escaping output impossible with the plugin.

image

Example: https://jsfiddle.net/0kwes0p0/3/

ashleydw added a commit to 3floorsup/bootstrap-select that referenced this issue Mar 31, 2016
@ashleydw
Copy link
Author

ashleydw commented Apr 1, 2016

The patch for this

- var label = this.parentNode.label,
+ var label = $('<div/>').text(this.parentNode.label).html(),

https://github.com/3floorsup/bootstrap-select/commit/f2ebdf3909c66aea98a3c0bff3e78b5b1e93c255.patch

patrickomeara pushed a commit to 3floorsup/bootstrap-select that referenced this issue Sep 13, 2016
avantika-gupta-jtg pushed a commit to JoshLabs/bootstrap-select that referenced this issue May 14, 2020
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