Ok i've found a solution:
According to @Peter Bailey's answer on this question i have created a custom twig extension to be able to add an url_decode filter to my {{ path() }}
tag like {{ path() |url_decode }}
.
This will prevent %QUERY
to be converted to %25QUERY
, an then it could be replaced in the rendered url by javascript.
Additionally i also add a |raw
filter, to avoid the ampersand beeing encoded. So finally my tag looks something like this: {{ path() |url_decode|raw }}