Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 07-27-2016, 01:42 PM   #1
brolny
Connoisseur
brolny began at the beginning.
 
Posts: 64
Karma: 10
Join Date: Sep 2015
Location: Yerevan, Armenia
Device: none
doubled id

These code examples are OK for Sigil, but not for Calibre.
Code:
<dd>Սա իմ <span id="b40b2">---------------</span> է։ (քույր)</dd>
<dd>Իմ <span id="b40b2">---------------</span> այնտեղ է աշխատում։ (հայր)</dd>

<h4 id="sigil_toc_id_217">Declension  ----------</h4>
<p id="sigil_toc_id_217">a) For the person to whom ---------------</p>
<p id="sigil_toc_id_217">b)  ---------------</p>
brolny is offline   Reply With Quote
Old 07-27-2016, 01:46 PM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,936
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
They really are NOT OK

id is a single use
You can only go to one place. ID marks that.

Where do you go when there are 3 'same places'?
theducks is offline   Reply With Quote
Advert
Old 07-27-2016, 01:48 PM   #3
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Is there a question here?

P.S. "id" needs to be unique, it is part of the HTML spec.
eschwartz is offline   Reply With Quote
Old 07-27-2016, 02:04 PM   #4
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,489
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by brolny View Post
These code examples are OK for Sigil, but not for Calibre.
Not sure what you mean by "OK for Sigil." If you mean that Sigil's Well-Formed Check doesn't flag it as a problem, then you're right. It doesn't. The Well-Formed Check is only concerned with syntactical problems like no missing quotes, and making sure all tags are properly closed and no improper nesting is going on. Things that could prevent an epub from being saved. It's not a "validator."

You'll be happy to know, however, that both the EpubCheck plugin and the Flightcrew plugin (epub2-only) will flag duplicate ids as a problem for you.

Sigil itself should NOT be creating any duplicate ids, though, if that's what you mean. If so, we'll need steps to recreate it. I've certainly never encountered a situation where one of Sigil's automated routines created any duplicated ids before.

Last edited by DiapDealer; 07-27-2016 at 02:13 PM.
DiapDealer is offline   Reply With Quote
Old 07-27-2016, 02:28 PM   #5
brolny
Connoisseur
brolny began at the beginning.
 
Posts: 64
Karma: 10
Join Date: Sep 2015
Location: Yerevan, Armenia
Device: none
Quote:
Originally Posted by DiapDealer View Post

Sigil itself should NOT be creating any duplicate ids, though, if that's what you mean. If so, we'll need steps to recreate it. I've certainly never encountered a situation where one of Sigil's automated routines created any duplicated ids before.
id="b40b2" - It's my error, I insert this id twice.

But id="sigil_toc_id_217" was created by Sigil, may be on <h5> -> <p>.
I don't realy know whay, but there is 9 different doubled id="sigil_toc_id_xxx".
Always with <h2 ... 5> and <p>.
brolny is offline   Reply With Quote
Advert
Old 07-27-2016, 02:38 PM   #6
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,489
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by brolny View Post
But id="sigil_toc_id_217" was created by Sigil, may be on <h5> -> <p>.
I don't realy know whay, but there is 9 different doubled id="sigil_toc_id_xxx".
Always with <h2 ... 5> and <p>.
If you merge two separate files that have the same ids (but are unique within their own file), you can end up with duplicate ids in the combined file. But that's the only way I could see it happening. It sounds like a copy/paste or Find & Replace gone wrong to me.

But if you can demonstrate some consistently reproducible steps where Sigil generates a duplicate ID in the same file, we'll certainly try to track it down.

Last edited by DiapDealer; 07-27-2016 at 02:41 PM.
DiapDealer is offline   Reply With Quote
Old 07-27-2016, 02:38 PM   #7
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,569
Karma: 5703586
Join Date: Nov 2009
Device: many
Something is strange. Sigil only inserts Sigil toc ids on header tags h1 - h6 as done when building a table of contents and never on p tags unless you manually add that to the toc.

Did you rebuild the table of contents without validating the epub was correct first? Did you use some other Sigil or outside tool?
KevinH is offline   Reply With Quote
Old 07-27-2016, 02:51 PM   #8
brolny
Connoisseur
brolny began at the beginning.
 
Posts: 64
Karma: 10
Join Date: Sep 2015
Location: Yerevan, Armenia
Device: none
Quote:
Originally Posted by KevinH View Post
Something is strange. Sigil only inserts Sigil toc ids on header tags h1 - h6 as done when building a table of contents and never on p tags unless you manually add that to the toc.

Did you rebuild the table of contents without validating the epub was correct first? Did you use some other Sigil or outside tool?
There are no auto toc id in <h1>.
I find out this when try to make link to <h1>, wihtout hand made id.
So, link is possible direct to the file.
It's the same when there is only one <h1> in the html file.

Yes, I rebuild contens 2-3 times with no effect,
so I delete all doubled id - after this id was recreated in right way.

No, I use Sigil only to egit epub.
All others programs to view only.
brolny is offline   Reply With Quote
Old 07-27-2016, 02:59 PM   #9
brolny
Connoisseur
brolny began at the beginning.
 
Posts: 64
Karma: 10
Join Date: Sep 2015
Location: Yerevan, Armenia
Device: none
Quote:
Originally Posted by DiapDealer View Post
If you merge two separate files that have the same ids (but are unique within their own file), you can end up with duplicate ids in the combined file. But that's the only way I could see it happening. It sounds like a copy/paste or Find & Replace gone wrong to me.

But if you can demonstrate some consistently reproducible steps where Sigil generates a duplicate ID in the same file, we'll certainly try to track it down.
No, there was no merge...
And I never edit id made by Sigil.

I have about 500 id, and I have no idea why 9 are double.
Not sure that I can reproduce this...
brolny is offline   Reply With Quote
Old 07-27-2016, 04:00 PM   #10
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,569
Karma: 5703586
Join Date: Nov 2009
Device: many
It almost looks like the p tags were at one time nested inside the h tag (illegal but it does display the way you expect in most browsers) and something split them out passing all attributes to its children (including the id). I just have no idea how that could happen inside of CodeView or the current Sigil tools.
KevinH is offline   Reply With Quote
Old 07-27-2016, 05:35 PM   #11
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,698
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
I was able to reproduce this non-issue with the following steps:

1. Create a new Sigil epub2 book.
2. Enter Chapter 1 in Code View mode, highlight it and apply a heading tag, e.g. h1
3. Repeat step 2 for Chapter 2.
4. Generate an NCX TOC to add an id value to the Chapter 2 h1 tag.
5. Switch to Book View mode, select Chapter 2 and copy it.
6. Paste the text and select No, when asked whether the text should be pasted as plain text.
7. Select the text pasted in step #6 and click the p button on the toolbar. This will change the tag from h1 to p, but won't delete the id value.
(Of course, you could also copy the heading tag in Code View mode, select only the copied text and click the p button.)

IMHO, this is pretty much the only way how the OP could have ended up with duplicate ids.
Doitsu is offline   Reply With Quote
Old 08-11-2016, 10:16 AM   #12
brolny
Connoisseur
brolny began at the beginning.
 
Posts: 64
Karma: 10
Join Date: Sep 2015
Location: Yerevan, Armenia
Device: none
It seems, that doubled numeration was the result of chapter's division.
When I divided one long chapter into two shorter parts within the Book View mode - not text only, header was diveded too.
Attached Files
File Type: epub doubledID.epub (57.8 KB, 111 views)
brolny is offline   Reply With Quote
Old 08-11-2016, 10:32 AM   #13
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,698
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by brolny View Post
It seems, that doubled numeration was the result of chapter's division.
When I divided one long chapter into two shorter parts within the Book View mode - not text only, header was diveded too.
Your sample file does not contain ids and split markers. Please add ids and split markers in a location that causes this problem and re-attach the file.

Last edited by Doitsu; 08-11-2016 at 10:35 AM.
Doitsu is offline   Reply With Quote
Old 08-11-2016, 11:00 AM   #14
brolny
Connoisseur
brolny began at the beginning.
 
Posts: 64
Karma: 10
Join Date: Sep 2015
Location: Yerevan, Armenia
Device: none
Quote:
Originally Posted by Doitsu View Post
Your sample file does not contain ids and split markers. Please add ids and split markers in a location that causes this problem and re-attach the file.
File has screenshorts/info how to reproduce the problem. I can send file with example later.
brolny is offline   Reply With Quote
Old 08-11-2016, 11:23 AM   #15
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,698
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
@KevinH and Diapdealer:

I was finally able to reproduce this issue:

1. Copy the following code to Section0001.xhtml in an empty epub:

Spoiler:
Code:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title></title>
</head>

<body>
  <h2 id="sigil_toc_id_1">This is a heading</h2>
</body>
</html>


2. Switch to Book View mode, enter a random string, e.g. XXX, before the heading text and press Enter. Repeat this several times.

3. Press CTRL+Enter or select Split At Cursor. This will generate the following code in the first split file:

Spoiler:
Code:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title></title>
</head>
<body>
  <h2 id="sigil_toc_id_1">xxx</h2>
<h2 id="sigil_toc_id_1">xxx</h2>
<h2 id="sigil_toc_id_1">xxx</h2>
<h2 id="sigil_toc_id_1">xxx</h2>
</body>
</html>


Needless to say that this is a user input error and shows once again that editing text in Book View mode is a bad idea.
Doitsu is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Removing doubled-up book covers CharredScribe Calibre 1 08-15-2015 12:33 PM
Non-breaking space (doubled) bug Camelot Sigil 49 02-13-2015 04:20 PM
PRS-T1 sync has doubled my collections Falchetta Sony Reader 2 07-08-2012 06:11 PM
Chapters are doubled in Table of Contents on Kobo...help!!! capsolo ePub 1 06-20-2010 12:58 PM
Every book in my library now doubled up on my 505 Gameboy213 Sony Reader 11 05-12-2009 06:49 PM


All times are GMT -4. The time now is 12:26 AM.


MobileRead.com is a privately owned, operated and funded community.