Quote:
Originally Posted by Algiedi
Very simply, what I'm trying to do, converting from html to mobi is:
When the actual chapter title in the book is "1", I want the corresponding TOC line to say "Chapter 1".
Can I do this with the Calibre XPath TOC generator thingy?
|
This conversation kinda got complicated in a hurry, but if anyone still cares, there's an easier way to do this that doesn't involve an epub/Sigil intermediate step. Just add custom span tags:
Code:
<h2>1</h2>
<span class="chaptitle" title="Chapter 1" />
Then, just set your xpath to:
Code:
//h:span[re:test(@class, "chaptitle", "i")]
Since the span is empty, it grabs the value from the title attribute.