It seems the <switchinline select="sys"> <caseinline select="MAC"> ... </caseinline> <defaultinline> ... </defaultinline> </switchinline> mechanism used in help documentation that displays different content for different OS platform is working as intended when used directly in the .xhp file, for example: https://help.libreoffice.org/7.3/en-US/text/shared/00/edit_menu.html?System=MAC shows the "Command+<key>" shortcuts for macOS correctly. And if one changes the URL to use "...?System=WIN", it will show "Ctrl+<key>" as it should. But if such text is embedded in another .xhp file, for example in: https://help.libreoffice.org/7.3/en-US/text/shared/01/02070000.html?System=MAC it shows wrong "CommandCtrl + Shift + V" while it should show "Command + Shift + V". I see this problem in both the 7.3/master online help (the URLs above) and local offline help installed from 7.2.0 RC3 MSI installer. Note that I tested on a Windows computer and hand-edited the "System=MAC" part of the URL, hope it's the correct way / same way a macOS computer would construct the URL.
This bug requires changes in + help3xsl/help2.js : // Find spans that need the switch treatment and give it to them var spans = document.querySelectorAll("[class^=switch]"); (...) function setApplSpan(spanZ) function setSystemSpan(spanZ) + help3xsl/online_transform.xsl : switch /switchinline case default
Note that we want to get rid of the switches completely, but it is not trivial
to fix this issue I need a javascript code that handles the current pseudo code For this use case System is WIN. Note that second switch must return the DEFAULT case. switch System { case MAC: mac help stuff break; case WIN: win help stuff switch System { case MAC: mac help2 stuff break; case DEFAULT: DEFAULT help2 stuff break; default: undefined system stuff } break; case UNIX: unix help stuff break; case DEFAULT: DEFAULT help stuff break; default: undefined system stuff }
Olivier Hallot committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/help/commit/886cebba80267127e47de6f5dad57745cfe54752 tdf#144859 - fix switch javascript logic.
fixed https://help.libreoffice.org/latest/en-US/text/shared/01/02070000.html?System=MAC