View Single Post
Old 10-04-2010, 04:03 AM   #7
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
Quote:
Originally Posted by Manichean View Post
Now you confused me- doesn't that test for the presence of numerals inside an h2 tag pair?
That's exactly what it does. Preprocessing just wraps the numerals in h2 tags, it doesn't tell Calibre's chapter detection routines that those are actually chapters.

The default chapter detection xpath is:
Code:
//*[((name()='h1' or name()='h2') and re:test(., 'chapter|book|section|part\s+', 'i')) or @class = 'chapter']
So that won't match numeric chapter headings. The book would get page breaks inserted at the H2 tags (based on the insert page breaks before default setting), so in an epub for example you would have one split file per chapter, but there would be no TOC.

You could just change one part of the xpath - 'chapter|book|section|part\s+' to '\d+' or '.*', but I used the xpath wizard, which spit out the xpath I posted previously.
ldolse is offline   Reply With Quote