09-12-2012, 03:47 AM | #1 |
New to ePub learnin' fast
Posts: 10
Karma: 10
Join Date: Aug 2012
Location: Perth, Western Australia
Device: Kindle Touch & iPad 3
|
Sigil won't save changes to id attribute in h1 tag
I noticed Sigil had given the same id attribute (heading_id_2) to the h1 tags in most (but not all) of my xhtml files. I changed them all so they were numbered consecutively (heading_id_1, heading_id_2, ....._3, etc) and saved the book. When I opened up the book again, in Sigil, it changed all the id attributes back to heading_id_2.
Does anyone know why this happens and how to overcome it? |
09-12-2012, 06:01 AM | #2 |
Grand Sorcerer
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
|
AFAIK, Sigil uses the heading_id tags for the automatic TOC generation. For some odd reason it restarts numbering for each .xhtml source page, however, this doesn't affect TOC generation.
If you want consecutive id tags to simplify the generation of an inline TOC, activate the regular expressions mode, search for id="heading_id_\d+" and replace it with nothing. Then use a regular expression to add a heading id number based on the chapter number and regenerate the TOC. For example, for a simple h1 chapter heading that contains only the chapter number (e.g. <h1>12</h1>) you'd use: Find: <h1>(\d+)</h1> Replace: <h1 id="heading_id_\1">\1</h1> |
Advert | |
|
09-12-2012, 12:28 PM | #3 | |
Berti
Posts: 1,196
Karma: 4985964
Join Date: Jan 2012
Location: Zischebattem
Device: Acer Lumiread
|
Quote:
This behaviour will result in duplicate id's if you merge 2 files. Sorry, but test it again ! |
|
09-12-2012, 09:41 PM | #4 |
New to ePub learnin' fast
Posts: 10
Karma: 10
Join Date: Aug 2012
Location: Perth, Western Australia
Device: Kindle Touch & iPad 3
|
Guys - thanks for your responses. I tried it again and this time it worked ok. User error first time around, no doubt, but I don't know what I did wrong. Oh well.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Please clarify tag name, attribute and value in Mobipocket Creator? | Michael_jones | Kindle Formats | 0 | 11-22-2011 04:10 PM |
'NoneType' object has no attribute 'tag'? | gweminence | Calibre | 7 | 09-13-2011 10:03 AM |
h3 tag is being changed on save | 1611mac | Sigil | 5 | 04-22-2011 05:04 PM |
Open and save an epub in sigil - won't load in Freda | p1000 | Sigil | 1 | 08-01-2010 01:32 PM |
tag <br /> causes epubeck error: attribute clear not allowed | georg3200 | ePub | 21 | 11-19-2009 08:50 PM |