kavingray / wp-ui

Tabs, accordions, sliders and more for WordPress
GNU General Public License v2.0
15 stars 10 forks source link

Spoiler name in non ASCII when user in links with anchors #4

Open stajp opened 11 years ago

stajp commented 11 years ago

When automatic spoiler opening by anchor name is used, there is a problem with some spoiler names.

If spoiler name has a non ASCII character (eg. local letters in UTF8), all non ASCII letters are filtered when they are put as "id" of H3 element (which is open/closed) (it seems filtration is on line 1430).

Because of that, links with hash anchors look distorted eg. wpspoiler name "Čevapčići" becomes #evapii

I presume same problem is with other elements (tabs, accordion). As it's nice to use ASCII letters in links, I would propose to use additional parameter in all elements for setting "anchor/hash name".

kavingray commented 11 years ago

Hello @stajp , The IDs are generated from headers for the sake of simplicity and character filtration was to maximize intercompatibilty with JavaScript and hashchange. Additionally this should not be a problem with HTML5, only lesser.

Maybe it can be modified to set your own IDs or remove the filtering.