Closed OndrejSpanel closed 4 years ago
Am I supposed to encode the href
value somehow, similar to what is done in how to encode href attribute in HTML ?
I supposed ScalaTags will do The Right Thing on its own, but perhaps it does not in this case.
Am I supposed to encode the href value somehow,
It seems I am. I encode individual query parameters using java.net.URLEncoder.encode(q, "UTF-8")
Assume following code (the real code is used to access GitHub repository actions):
The result seems to be:
<a href="https://a.com/page?query=workflow:"CI Error"">CI Error</a>
While Chrome accepts such links, I think it is not correct and some user agents (namely Flying Saucer library) reject such hrefs as "containing invalid characters" because of the space in the
CI Error
. I think space in this place should be encoding using+
(plus sign).How should I achieve a proper encoding of the href value?