View Single Post
Old 09-16-2022, 01:23 AM   #23
un_pogaz
Chalut o/
un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.
 
un_pogaz's Avatar
 
Posts: 446
Karma: 672378
Join Date: Dec 2017
Device: Kobo
In the same way that @chaley you suggested a to_hex(), I will suggest a to_url() which would allow to make calibre scheme more human like (and will avoid any bugs).
Code:
def evaluate(self, formatter, kwargs, mi, locals, val):
    from urllib.parse import quote
    return quote(val)
Bal masqué

Bal%20masqu%C3%A9

Code:
<a href="calibre://search/_?q=tags:%22=' & to_url(i) & '%22">
<a href="calibre://search/_?q=tags:%22=Bal%20masqu%C3%A9%22">

Last edited by un_pogaz; 09-16-2022 at 01:46 AM.
un_pogaz is online now   Reply With Quote