When I tried org-protocol for the first time, I was quite surprised that
query parameters generated using URLSearchParams JavaScript class are
decoded incorrectly. "+" characters representing space are passed as is.
I hope, I have found a proper place in the code to handle such case.
It does not affect previously recommended bookmarklets with abundant
calls of encodeURIComponent that escapes spaces as "%20". I believe, new
option is more readable:
javascript:location.href='org-protocol://capture?' +
new URLSearchParams({
template: 'x',
url: location.href,
title: document.title,
body: window.getSelection()});
I guess, with old org-protocol syntax only pure percent encoding was
necessary due to each parameter was represented as path component. "+"
is allowed only in query part. Such variant was just missed when new
query-like syntax was introduced.