![]() |
<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 |
Where was your split marker put?
|
And did you have the h1 tags properly ended with '>' chars which does not appear above.
|
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"?> |
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. |
Quote:
|
If anyone still uses Sigil-0.8.X I would love to know if it exhibits this same behaviour.
|
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. |
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. |
| All times are GMT -4. The time now is 10:34 PM. |
Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.