More exceptions to percent encoding

See #11511
This commit is contained in:
Juergen Spitzmueller 2019-03-10 16:37:31 +01:00
parent 3d08c83666
commit 3c83f01f1b

View File

@ -133,8 +133,9 @@ void InsetHyperlink::latex(otexstream & os,
if (!url.empty()) {
// Use URI/URL-style percent-encoded string (hexadecimal).
// We exclude some characters that must not be transformed
// in hrefs (% # / : ? = &) or that we need to treat manually (\).
url = to_percent_encoding(url, from_ascii("%#\\/:?=&"));
// in hrefs: % # / : ? = & ! * ' ( ) ; @ + $ , [ ]
// or that we need to treat manually: \.
url = to_percent_encoding(url, from_ascii("%#\\/:?=&!*'();@+$,[]"));
// We handle \ manually since \\ is valid
for (size_t i = 0, pos;
(pos = url.find('\\', i)) != string::npos;