Quote:
Originally Posted by RbnJrg
I didn't know that Calibre could work with RegEx inside a specific element. I'll do a research to see what can I get there. Thanks for the info.
|
I rarely use Calibe Editor, but the following should work for you.
- Paste <h1([^>]*)>([^<]+)</h1> in the Find box.
- Select Regex-function from the Mode drop-down box.
- Click Create/Edit, paste the following code in the Code box:
Code:
def replace(match, number, file_name, metadata, dictionaries, data, functions, *args, **kwargs):
return '<h1' + match.group(1) + '>' + match.group(2).replace(' ', '§').replace(' ', '').replace('§', ' ') + '</h1>'
enter a function name, e.g. Ruben, and click OK.