View Single Post
Old 03-26-2013, 02:10 PM   #9
meme
Sigil developer
meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.
 
Posts: 1,275
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
At least in the newest version, if you hit return a few times in Book View you will end up with a few <p><br /></p>. If you then delete one of these empty lines, they get deleted completely, so no <br /> is left. It will be left if there is something else in the line.

The hourglass showing on the dialog will be fixed in the next version.

With regards to your comment about style appearing when you delete, this is because the Book View editor is trying to retain the formatting you've given the paragraphs, even if this is a bit annoying. This has nothing to do with Pretty Print or Tidy. I think it's worth showing what is happening:

In this particular case, say you have this:

Code:
<p>Line one.</p>
<p>Line two.</p>
In Book View, if you put your cursor at the end of the first line ("Line one.") then hit Delete, you will see this in Code View:

Code:
<p>Line one.Line two.</p>
Which is what you expect.

But if you start with this:

Code:
<p>Line one.</p>
<p class="test">Line two.</p>
and the class "test" is defined in your stylesheet as "font-weight: bold"

then in Book View put your cursor at the end of "Line one." and hit Delete, you will see this in Code View:

Code:
<p>Line one.<span style="font-weight: bold;">Line two.</span></p>
This is because the first paragraph had no styling/class, but the second paragraph did. When the editor merged the two it tries to keep the styling of the second paragraph and can only do this by using a span and the styles that were defined for the original paragraph.

It cannot just use span class="test" because that class might not apply to a span, only to a paragraph. Although if the class "test" isn't actually defined or linked to this page then you end up with the first case where no span is added. And if both paragraphs had a class of "test" (i.e. the exact same styling), then the second would be merged without the span being added since it knows they are the same.

I guess it could ignore the styling of the second paragraph when merging which I think would be simpler for most people to deal with - but that might cause other issues - and anyway we have no control over that - it's part of Qt.


Working in Book View is easy to start with, but once you learn about Code View and tags and you want full control over what is going on it can be pretty annoying. If you are going to write in Book View you will have to accept what it gives you, or as pointed out above, develop a few common Save Searches to correct the parts that bother you - but use them carefully. I'm always using Book View even though I always try not to - so I end up having to search through for extra <br /> tags, style attributes, nbsp characters, etc.

Sigil wasn't really designed to write books from scratch. It was meant to update formatting, etc. - which is best done in Code View, perhaps with the help of Preview. Of course, it can be used to write and correct text in Book View quite easily, but there is a trade-off for using it.
meme is offline   Reply With Quote