You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice if the "copy link" feature from v5.0.0 preserved explicit underscores in titles and sections and lowercase titles. See e.g. systemd, mod_python, VMware#Package build for x86_64.
The text was updated successfully, but these errors were encountered:
(What follows is mostly a note to myself; tl;dr we'll have to stick to manual link fixing for a while longer... ^^)
Currently the "copy link" feature uses the "id" attribute of the heading's span.mw-headline element, which uses underscores only, which I naively replace with spaces. To partly fix this problem I could use the rendered section heading directly, but for example I use automatic heading numbers, which are spans that are unfortunately simply prepended to the rendered heading title thus making it quite a messy job to isolate the wanted content safely...
It's very interesting (for me) to note that headings with breaking characters are given an additional span element with a dot-encoded id attribute! It will be useful...
About title casing, currently I'm using the (hopefully safe enough) Javascript API, which doesn't seem to care about lcfirst though, so to respect capitalization I should resort to using the rendered page title, but that feels messy (see above) and without proper tests I don't know what that would break.
I should really approach this whole problem scientifically and properly find out what breaks when, with properly designed tests, and find the best way to address each case, i.e. where to read the title to put in the link, how to further encode or decode it, and whether to use a label (and maybe add another command to copy a link with or without a label, i.e. pretty-and-long or ugly-and-short). I've looked for some function already on the market but couldn't find anything
As a temporary fix I could add a command for each of the possible ways to read titles and section headings and compose links with them, and then let the user decide which one to use, but it would become more confusing to use than it is now.
It would be nice if the "copy link" feature from v5.0.0 preserved explicit underscores in titles and sections and lowercase titles. See e.g. systemd, mod_python, VMware#Package build for x86_64.
The text was updated successfully, but these errors were encountered: