View Single Post
Old 10-06-2021, 07:40 AM   #5
lomkiri
Groupie
lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.
 
lomkiri's Avatar
 
Posts: 167
Karma: 1497966
Join Date: Jul 2021
Device: N/A
That's just a work-around, but it does what you want and will work in calibre 3.xx
Create a regex-function (search box, pulldown "regex-fucntion" button "create") that does this:
Code:
def replace(match, number, file_name, metadata, dictionaries, data, functions, *args, **kwargs):
    return '<span class"red">{}</span>'.format(match.group(0))
Then, with this regex-function active in your search box, you can select a text, then hit Ctrl-F Ctrl-R, it will do the job (or, same thing, click Search then Replace).
lomkiri is offline   Reply With Quote