Semantic-Org / Semantic-UI

Semantic is a UI component framework based around useful principles from natural language.
http://www.semantic-ui.com
MIT License
51.1k stars 4.95k forks source link

[Tab] should escape meta characters before sending to jquery #6750

Open ellemenno opened 5 years ago

ellemenno commented 5 years ago

When tabPath is sent to jQuery in tab.js#L382, it does not escape meta characters such as code>!"#$%&'()*+,./:;<=>?@[]`{|}~</code, which can result in uncaught errors.

e.g. kramdown creates footnote fragment links in the format #fn:4, which results in the following error from tab.js+jQuery:

Uncaught Error: Syntax error, unrecognized expression: unsupported pseudo: 4

According the the jQuery docs, meta characters should be escaped via double backslashes (\\): http://api.jquery.com/category/selectors/

ellemenno commented 5 years ago

jsfiddle to reproduce issue: https://jsfiddle.net/ellemenno/f1tdw9pm/

lubber-de commented 5 years ago

Added escaping in https://github.com/fomantic/Fomantic-UI See your adjusted fiddle here https://jsfiddle.net/us495x0f/

ellemenno commented 5 years ago

@lubber-de —thanks, that was fast!

It looks like FUI also has a supported SASS distro? hmm.. i'll look at this project more closely.