dokuwiki_plugin_wrap
dokuwiki_plugin_wrap copied to clipboard
Anchors are converted to lowercase
Hi,
anchors written as <wrap #ThisIsMyAnchor /> seem to be converted into <span id="thisismyanchor"></span>, which breaks their usability. Is there a specific reason, why the case of the anchor text is not preserved?
We e.g. use (resp. wanted to use) these anchors to link to specific tags within the page. These tags are e.g. ticket identifiers from external companies and have a specific, given, case sensitivity. Manually having to change the case sensitivity before using them instead of being able to copy-paste them into e.g. the URL would make these anchors - for this use-case - useless.
I'm also happy to manually patch our installation of the wrap plugin, but unfortunately I have no idea, where this would have to be done. I'm happy to receive any pointers.
This may be native Dokuwiki behavior unrelated to the plugin.
🤔 maybe, I can't assess that. An opinion of a Wrap Plugin developer might help.
After a quick look I could not spot a conversion to lower case yet. https://github.com/selfthinker/dokuwiki_plugin_wrap/blob/81450d7519e8f4da56e6fb2b8dcc98e1a01648ff/helper.php#L82
https://github.com/selfthinker/dokuwiki_plugin_wrap/blob/81450d7519e8f4da56e6fb2b8dcc98e1a01648ff/helper.php#L135
However, after another look, I suspect this is already lowering it:
https://github.com/selfthinker/dokuwiki_plugin_wrap/blob/81450d7519e8f4da56e6fb2b8dcc98e1a01648ff/syntax/span.php#L43
For a lot of cases this might make sense. Probably a bit bruteforce for this case. I do not see an easy workaround yet.
DokuWiki typically converts ids of headers e.g. for pointers from Table of contents: https://github.com/dokuwiki/dokuwiki/blob/90293b2f851c3e131856d6c7fe43403a3d628773/inc/parser/xhtml.php#L227 Which uses sectionID() on the end.