dokuwiki_plugin_wrap icon indicating copy to clipboard operation
dokuwiki_plugin_wrap copied to clipboard

Anchors are converted to lowercase

Open fthommen opened this issue 9 months ago • 3 comments

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.

fthommen avatar Mar 06 '25 16:03 fthommen

This may be native Dokuwiki behavior unrelated to the plugin.

chimpden avatar Apr 04 '25 16:04 chimpden

🤔 maybe, I can't assess that. An opinion of a Wrap Plugin developer might help.

fthommen avatar Apr 04 '25 21:04 fthommen

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.

Klap-in avatar Jul 01 '25 21:07 Klap-in