It appears to me that the regex matching in calbre is broken. I was able to successfully edit the parsed html file with a regex that uses \n for a line break using a python script, but the same identical regex does not work when I use it through the calibre interface. Or from the calibre command line ebook-convert.
For anyone having issue with the header or footer regex in calibre, one way to get around it is to:
1. enable debug so the files for intermediate conversion steps are written to a directory, and then convert your ebook without worrying about the footer regex.
2. create your regex normally, but use it from a python prompt to modify the file. The file you want to modify is the index.html in the parsed directory from step 1.
3. load the modified index.html back into calibre as a new book. Then complete the conversion to whatever format you want from that book.
Not very elegant, but it does work.
I will submit a bug report on this topic.
|