Problem/Motivation
I have an accordion with the title EnEspanol that includes a tilde n as to be correct- when creating the anchor link this gets stripped out rather than replaced by an n. We are trying to provide a link to a drop-down containing spanish documents and it should be /URL#enespanol and instead it is URL/#enespaol - which is less than ideal especially for sharing as a URL with people.
Steps to reproduce
Create an CKEditor accordion block with an accented character for the title, enable Open tabs with hash using anchor links or on page load - look at the resulting anchor link.
Proposed resolution
In accordion.frontend.js the tabText around 159 should have accented characters replaced with the best ASCII code character vs. stripping them completely since according to https://www.rfc-editor.org/rfc/rfc3986#section-2 - only ASCII characters should be included in URI and I assume this includes anchor links.
Comments
Comment #2
robbt commentedI think that using the Fold to Ascii javascript library before stripping out non-ascii characters would be the ideal solution but I'm not sure if it warrants the effort to include another javascript library. I can easily patch the line of code to solve my individual use case but if there is interest in solving this problem with best practices then including the library could be a good option and I could work on implementing it as a PR.