Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 12-08-2020, 09:25 AM   #1
ghogsett
Junior Member
ghogsett began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Dec 2020
Device: Kindle
<div missing after splits

Given:

<body>
<div class=...>
<h1 chapter 1
<hr>
<h1 chapter 2
</div>
</body>

After splitting on markers, the <div> </div> pair were missing from all the files. Had to put them in manually
ghogsett is offline   Reply With Quote
Old 12-08-2020, 09:47 AM   #2
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: 7,661
Karma: 5433388
Join Date: Nov 2009
Device: many
Where was your split marker put?
KevinH is online now   Reply With Quote
Advert
Old 12-08-2020, 09:48 AM   #3
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: 7,661
Karma: 5433388
Join Date: Nov 2009
Device: many
And did you have the h1 tags properly ended with '>' chars which does not appear above.
KevinH is online now   Reply With Quote
Old 12-08-2020, 09:48 AM   #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: 27,553
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I can duplicate this in the latest github master. For others: here's a complete file suitable for testing.

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>
<div class="whatever">
<h1> chapter 1</h1>
<hr class="sigil_split_marker" />
<h1> chapter 2</h1>
</div>
</body>
</html>
Split at Cursor (cursor placed before the hr or the 2nd h1) preserves the containing div in the newly created file. When using Split at Markers the containing div is NOT preserved in the newly created file.
DiapDealer is offline   Reply With Quote
Old 12-08-2020, 10:04 AM   #5
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: 7,661
Karma: 5433388
Join Date: Nov 2009
Device: many
Hmmm ... split at cursor is handled almost entirely within CodeViewEditor.cpp code with some help from Book.cpp, where as "split at markers" is handled completely outside the file or editor as it is meant to be recursive and possibly apply across multiple files.

I will look into this but there will always be some nested structures that will not survive splitting at certain points when using Split at Markers as opposed to splitting only once inside of a file using Split at Cursor.

To be safest, split at marker split points should be chosen by the user to be a direct child of the body tag. In this case the split at marker is a direct child of the div which typically indicates that this block should not be broken there as div are used to physically and logically group things. Ie. you typically want to split the body into multiple parts.

Last edited by KevinH; 12-08-2020 at 10:10 AM.
KevinH is online now   Reply With Quote
Advert
Old 12-08-2020, 10:08 AM   #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: 27,553
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by KevinH View Post
I will look into this but there will always be some nested structures that will not survive splitting at certain points when using Split at Markers as opposed to splitting only once inside of a file using Split at Cursor.
I thought I remembered there being subtle difference between the two split features RE nested structures. The div container is essentially a second body tag in this case. Structurally and stylistically there would be no difference between this and giving the body tags of files different classes if need be. But that's neither here nor there.

Last edited by DiapDealer; 12-08-2020 at 10:13 AM.
DiapDealer is offline   Reply With Quote
Old 12-08-2020, 10:10 AM   #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: 7,661
Karma: 5433388
Join Date: Nov 2009
Device: many
If anyone still uses Sigil-0.8.X I would love to know if it exhibits this same behaviour.
KevinH is online now   Reply With Quote
Old 12-08-2020, 11:11 AM   #8
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: 7,661
Karma: 5433388
Join Date: Nov 2009
Device: many
Yes, after checking the code for split at markers, this is not a bug but expected behaviour if the split marker is inserted at a point that is not a direct child of the body.

If you want to make a split at some point not a direct child of the body tag, then open that file in CodeView and position your cursor to the split point and use Split At Cursor.
KevinH is online now   Reply With Quote
Old 12-08-2020, 12:22 PM   #9
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: 7,661
Karma: 5433388
Join Date: Nov 2009
Device: many
All of that said, there really is no sound reason to not properly handle nesting (or at least try to).
My worry when doing this is that other attributes will be copied as well including id attributes which would and could mess up Anchor Updating after splitting is done.

I have copied the approach of Split at Cursor and tried implementing it with Split At Markers.
I will tentatively commit this change to master and we can test it to make sure that any id attributes on any nested tags at break points do not cause problems.

If they do end up causing issues, we will revert it and Split at Cursor will be the only way for you to handle this case on a one by one basis.

Thank you for your bug report.
KevinH is online now   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ePub + CSS -> PDF = in xhtml splits cozylummox Conversion 2 07-18-2020 12:23 AM
Adding Splits to an EPUB rlevesque Conversion 5 02-03-2017 05:38 PM
Doing the splits mrmikel Editor 9 01-06-2014 11:19 AM
why does tall image splits into two pages.?!! ali_86 ePub 5 01-20-2013 07:32 PM
Controlling Calibre's Splits for epubs. brewt Calibre 4 12-31-2008 03:10 PM


All times are GMT -4. The time now is 01:35 PM.


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