But what gets rendered in the browser (-> "view source") is this:
<a href="solutions-#%7B1%7D">XX</a>
That means, the curly brackets got percent-encoded / url-encoded.
This kind of replacement only seems to happen with strings that are part of an href. If I place the same string into an attribute like id or as text into any tag, the syntax is preserved.
I would love to get a pointer on where in the code of Plone this treatment of links is happening, so that I can work on a solution for my problem.
Not really related to the question (and probably a bad idea), but could it be possible to make a workaround by using tal:attributes if it has something to do with chameleon ?
Thanks for all the hints so far. I can confirm, on a standard Plone5 (5.1) installation, this is not a problem.
My site is somewhat special since it uses Chameleon and NuPlone, and due to the latter (and the use of Euphorie), I have only a very reduced set of Plone management screens (ZMI is fully functional though).
Update: @jaroel was right, it happens via lxml. But in a different spot.
Details: In ZPublisher.Publish.publish(), there's a call to notify(PubBeforeCommit(request)), which leads to plone/transformchain/zpublisher.py(86)applyTransformOnSuccess(). One of the handlers that act upon that event is plone.protect.auto.ProtectTransform.
So in the end, we land here:
Up until here, the result contains the href with the curly brackets intact. But when the html.tostring serializer gets applied, the curly brackets get replaced in the href when result is rendered.
The fact that I even land in this part of the code (versus stock Plone 5.1), is because the handler before that, "plone.app.theming.transform" does nothing. Therefore, result is still in the original state that gets passed in to plone.transformchain.transformer, that means a list of strings.
In stock Plone 5.1, "plone.app.theming.transform" does indeed return output, so by the time the transformer is called in plone.protect, result is an instance of XMLSerializer, and the lxml transform (html.tostring) never happens, because of
So finally, I think I have an idea what to do in my custom site to circumvent that problem.
Edit:
And of course this leads me back to Roel's suggestion about
which in my case is not used, because the theme itself is not enabled...