View Single Post
Old 12-03-2011, 03:20 AM   #1
nosnoop
Enthusiast
nosnoop is a rising star in the heavensnosnoop is a rising star in the heavensnosnoop is a rising star in the heavensnosnoop is a rising star in the heavensnosnoop is a rising star in the heavensnosnoop is a rising star in the heavensnosnoop is a rising star in the heavensnosnoop is a rising star in the heavensnosnoop is a rising star in the heavensnosnoop is a rising star in the heavensnosnoop is a rising star in the heavens
 
Posts: 45
Karma: 13564
Join Date: Nov 2011
Device: Kindle Paperwhite; PRS-T1
TXT-> EPUB TOC problem

I am converting from Txt-> ePub, and I am trying to generate TOC.
Language is in Unicode Chinese.

I am using this XPath Expression for both Level 1 TOC, Structure Detection and Insert Page break:
//*[re:test(., "第.(章|回)", "i")]

All other settings as default except a @font-face entry in Extra CSS.
I have double checked the regex in search & replace and it should work. All the chapters are referenced properly, except two extra entries on the top.

And I get this in the ePub xhtml:
Code:
<?xml version='1.0' encoding='utf-8'?>
<html xmlns="http://www.w3.org/1999/xhtml" id="calibre_toc_1" style="page-break-before:always">
  <head>
....
  <div style="display: block; page-break-after: always"></div>
  <body id="calibre_toc_2" class="calibre">
<div class="calibre1"></div><p id="calibre_toc_3" class="calibre2">第1章</p>
<p class="softbreak">*</p>
So the calibre_toc_1 and calibre_toc_2 are in the wrong place, and the toc.ncx including 1000+ characters from the content in the <text></text> tag for each of them.

Tried checking "Do not add detected chapters..."; same results.
Tried removing all entries in Structure Detection and Insert Page break.... same results.

Any pointers would be most appreciated.
Calibre Portable 0.8.29

Last edited by nosnoop; 12-03-2011 at 03:31 AM.
nosnoop is offline   Reply With Quote