View Single Post
Old 03-26-2013, 09:35 PM   #10
Gregg Bell
Gregg Bell
Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.
 
Gregg Bell's Avatar
 
Posts: 800
Karma: 3218924
Join Date: Jan 2013
Location: Itasca, Illinois
Device: none
thanks

Quote:
Originally Posted by meme View Post
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.
Thanks meme. I, since this thread began, have switched to doing all the editing in code so I'm cool with this. But I'm not so sure if I get your explanation of what happens. I say this because when I did my Book View thing, it was in the middle of ordinary paragraphs, just regular p tags. I even did your "Line one. Line two" experiment and in the middle of regular paragraphs and it gave me the <span style="text-indent:1.5em;"> text </span></p> deal. I've enclosed a screenshot.

Now, my external style sheet is for text indent of 1.5em if that sheds any light on things.

And how do I get around the hourglass thing?

Thanks a lot for your input on this. It's very helpful.
Attached Files
File Type: doc ptagexperiment.doc (144.0 KB, 28 views)
Gregg Bell is offline   Reply With Quote