Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 06-07-2018, 09:28 AM   #1
un_pogaz
Chalut o/
un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.
 
un_pogaz's Avatar
 
Posts: 410
Karma: 145324
Join Date: Dec 2017
Device: Kobo
[Bug?] Sigil's inconsistent behavior with italics and bold

In "code display" mode, when bold or italicized, Sigil uses the markup <i> and <b>.
But, in "book display" mode, Sigil uses the markup <span style="font-style: italic;"> and <span style="font-weight: bold;">.

Why?
Wouldn't it be easier and more logical to use the markup <i> and <b> in both modes?
(in addition, the second method unnecessarily overloads the code, I like to keep my code readable)

Sorry for the rough tone , but I find that having to cheat with the "clips" to get the logical behavior is weird and very unfortunate for this excellent software.
un_pogaz is offline   Reply With Quote
Old 06-07-2018, 11:10 AM   #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: 29,778
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
It really is not recommended to make edits in Bookview.

FWIW I use Preview (on a second monitor) to visually review the look and sync up the code to the block with the focus in the preview.
All edits are done in code view

The only time I use BV, is when there is a pink, error box showing that I can't spot the issue. Attempting to switch, gives you the option to MANUALLY fix the code, AND that usually takes you to the problem
theducks is offline   Reply With Quote
Advert
Old 06-07-2018, 03:58 PM   #3
Notjohn
mostly an observer
Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.
 
Posts: 1,515
Karma: 987654
Join Date: Dec 2012
Device: Kindle
>Sigil uses the markup <span style="font-style: italic;"> and <span style="font-weight: bold;">.

It does? I've never seen that, though like Ducks I rarely use Book View now that I have the Preview panel.

I thought the whole point of (the now mostly irrelevant) Book View was NOT to show markup, but the book as it will appear to the ultimate reader?
Notjohn is offline   Reply With Quote
Old 06-07-2018, 05:09 PM   #4
BeckyEbook
Guru
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 687
Karma: 2180740
Join Date: Jan 2017
Location: Poland
Device: Kindle (Key3, PW2, PW3), Nook (ST, GLP), Kobo Touch, Tolino Vision 2
For me Book View is too dangerous to use as an editor. I use only Code View.

Step-by-step to crash:
1. New file
2. In Code View write "ok"
Code:
<p>ok</p>
3. Select letter "k".
4. Press Ctrl-I or press "Italic" button from toolbar (to enable italic)
Code:
<p>o<i>k</i></p>
5. Go to Book View (F9 or Book View button).
6. Select italic letter "k" only.
7. Press Ctrl-I or press "Italic" button from toolbar (to disable italic)
8. Try back to Code View (F11 or Code View button).

Last point causes a crash every time.
Sigil 0.9.9 original AND Sigil 0.9.9 with all commits from GitHub.
Windows 7 Pro, Windows 10 Pro
BeckyEbook is offline   Reply With Quote
Old 06-07-2018, 06:37 PM   #5
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,583
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by un_pogaz View Post
(in addition, the second method unnecessarily overloads the code, I like to keep my code readable)
IIRC, the bold/italic inline styles are automatically generated by the Qt control used for Book View, which is different from the Qt control used for Code View. I.e., there's no C++ code that could be easily changed to fix this behavior.

Quote:
Originally Posted by BeckyEbook View Post
For me Book View is too dangerous to use as an editor. I use only Code View[...]
I was able to reproduce this bug on my 64bit Windows 10 machine, but not on my 64bit Arch Linux machine.
I.e., it's most likely a Windows-only bug.

@DiapDealer: I was also able to reproduce this bug with Sigil 0.9.0, but not with Sigil 0.8.6.

Last edited by Doitsu; 06-08-2018 at 02:39 AM.
Doitsu is offline   Reply With Quote
Advert
Old 06-07-2018, 07:02 PM   #6
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,630
Karma: 5433388
Join Date: Nov 2009
Device: many
I will look into and fix the crash if I can recreate it.

Please understand BookView is really live editing of the dom in a browser window and therefore is controlled by the underlying Qt webkit widget. The code the widget generates has two settings but in "tag mode" it uses no longer allowed tags, so we switched to "inline style mode" which people hate but was at least legal html.

The real problem with BookView is that text can easily be selected that crosses tag boundaries making live editing generate some horrible illegal code.

Once I understand how to both copy from Preview and to paste into a small webkit window, BookView will be history as it would provide nothing over Preview
KevinH is offline   Reply With Quote
Old 06-07-2018, 09:05 PM   #7
Thasaidon
Hedge Wizard
Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.
 
Thasaidon's Avatar
 
Posts: 800
Karma: 19999999
Join Date: May 2011
Location: UK/Philippines
Device: Kobo Touch, Nook Simple
Quote:
Originally Posted by KevinH View Post
Once I understand how to both copy from Preview and to paste into a small webkit window, BookView will be history as it would provide nothing over Preview
May the day come soon.
Thasaidon is offline   Reply With Quote
Old 06-08-2018, 08:16 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,630
Karma: 5433388
Join Date: Nov 2009
Device: many
FWIW,
I can not recreate this at all on a Mac. When you move back to CodeView after following your procedure you see exactly what you would expect to see just the
Code:
<p>ok</p>
.

If you (or anyone with Windows) can repeatedly generate a crash of Sigil please enable the debugger (if you know how) to generate a backtrace so that we have some idea of where the Windows related bug may be happening.

DiapDealer when you get a few free moments will you take a look at this? It really does appear to be a Windows only bug (Qt related?).

Kevin


Quote:
Originally Posted by BeckyEbook View Post
For me Book View is too dangerous to use as an editor. I use only Code View.

Step-by-step to crash:
1. New file
2. In Code View write "ok"
Code:
<p>ok</p>
3. Select letter "k".
4. Press Ctrl-I or press "Italic" button from toolbar (to enable italic)
Code:
<p>o<i>k</i></p>
5. Go to Book View (F9 or Book View button).
6. Select italic letter "k" only.
7. Press Ctrl-I or press "Italic" button from toolbar (to disable italic)
8. Try back to Code View (F11 or Code View button).

Last point causes a crash every time.
Sigil 0.9.9 original AND Sigil 0.9.9 with all commits from GitHub.
Windows 7 Pro, Windows 10 Pro

Last edited by KevinH; 06-08-2018 at 08:19 AM.
KevinH is offline   Reply With Quote
Old 06-08-2018, 08:24 AM   #9
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,546
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by KevinH View Post
DiapDealer when you get a few free moments will you take a look at this? It really does appear to be a Windows only bug (Qt related?).
I should be able to find some time this weekend. I'll check Linux as well (unless someone already has). Linux often seems to mirror the Windows bugs for whatever reason. At least where Sigil/Qt is concerned.
DiapDealer is offline   Reply With Quote
Old 06-08-2018, 09:29 AM   #10
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,583
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by DiapDealer View Post
I should be able to find some time this weekend. I'll check Linux as well (unless someone already has).
The bug doesn't affect the Linux version of Sigil. Since it also doesn't occur with Sigil 0.8.6 it must have been introduced in one of the last 0.8.x versions. (I only tested Sigil 0.8.6.)
Doitsu is offline   Reply With Quote
Old 06-08-2018, 10:11 AM   #11
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,630
Karma: 5433388
Join Date: Nov 2009
Device: many
Or it is a bug in Qt versions which we have updated several times since then.

Quote:
Originally Posted by Doitsu View Post
The bug doesn't affect the Linux version of Sigil. Since it also doesn't occur with Sigil 0.8.6 it must have been introduced in one of the last 0.8.x versions. (I only tested Sigil 0.8.6.)
KevinH is offline   Reply With Quote
Old 06-08-2018, 10:57 AM   #12
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,546
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Forget all the creating/styling in Code View and then flipping to Book View to undo said styling. I'm not near my development machine, but here's what I'm getting:

1) Open Sigil and go directly to Book View
2) type some words
3) highlight any portion (just not the whole thing) of what you type and style it (bold, italic, strike, sub- super-script--whatever you want), then immediately unstyle it (click the same style button)
4) switch to Code View
Crash

The short of it is: styling and then immediately unstyling anything other than the entire contents of what is in Book View will result in a crash when switching to Code View.

The only exception is that you can unstyle a portion of what you originally styled and the crash doesn't happen when switching.

Select the entire contents of Book View and style/unstyle: you'll get no crash when switching.

Select a portion of the contents of Book View and style/unstyle the same portion: it crashes when switching.

Select a portion of the contents of Book View and style it and then unstyle only a portion of what you styled: no crash when switching.

It suggests some flaky QCursor behavior on Windows to me. I'll try to get some debugging output this weekend some time.

Last edited by DiapDealer; 06-08-2018 at 11:24 AM.
DiapDealer is offline   Reply With Quote
Old 06-08-2018, 11:20 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,583
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by DiapDealer View Post
It some suggests some flaky QCursor behavior on Windows to me. I'll try to get some debugging output this weekend some time.
Unfortunately, I also managed to crash the Linux version of Sigil using your method. I.e., the problem also affects other operating systems.
Doitsu is offline   Reply With Quote
Old 06-08-2018, 11:25 AM   #14
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,546
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by Doitsu View Post
Unfortunately, I also managed to crash the Linux version of Sigil using your method. I.e., the problem also affects other operating systems.
Thanks. I would have been highly surprised had it truly been a Windows-only issue.

P.S. And it's not "unfortunate" at all, really. You've done me a favor! Debugging it on Linux will be a breeze compared to trying to pry clues from Windows' uncooperative fingers.

The unfortunate part is that there's no guarantee we can even address the issue (provided debugging proves successful) if it's deep inside one of those Qt widget functions. How much do you want to bet that the problem goes away if we reverted back to the "tag mode" option -- which of course generates invalid tags?

Last edited by DiapDealer; 06-08-2018 at 11:37 AM.
DiapDealer is offline   Reply With Quote
Old 06-08-2018, 11:56 AM   #15
JustinThought
Groupie
JustinThought ought to be getting tired of karma fortunes by now.JustinThought ought to be getting tired of karma fortunes by now.JustinThought ought to be getting tired of karma fortunes by now.JustinThought ought to be getting tired of karma fortunes by now.JustinThought ought to be getting tired of karma fortunes by now.JustinThought ought to be getting tired of karma fortunes by now.JustinThought ought to be getting tired of karma fortunes by now.JustinThought ought to be getting tired of karma fortunes by now.JustinThought ought to be getting tired of karma fortunes by now.JustinThought ought to be getting tired of karma fortunes by now.JustinThought ought to be getting tired of karma fortunes by now.
 
JustinThought's Avatar
 
Posts: 171
Karma: 3517858
Join Date: May 2016
Location: Monterrey, Mexico
Device: Samsung Tab-3 7"
Quote:
Originally Posted by KevinH View Post
//snip!//
Once I understand how to both copy from Preview and to paste into a small webkit window, BookView will be history as it would provide nothing over Preview
I will rue the day that occurs. I'm one of those weirdos who regularly uses book view as a convenient editor. And yes, I realize that the code that comes out of this is not the optimum; but, with a quick f7, followed by a couple'a searches and replaces, and a little attention from DiapDealer's TagMechanic, I've got the clean code I like. Some of that is necessary anyway, because I have a tendency to use the <em> and <strong> tags along with a class that reiterates the style, so no matter how I get the text into Sigil, I have to do some housekeeping to get what I "want."

But I do understand that it's a huge maintenance problem, so once it does go away, I'll just accept that fact and find another way to skin that particular cat.
JustinThought is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
bold and italics FAMOsa Sigil 7 09-09-2017 12:15 PM
Email to Kindle - plugboard behavior inconsistent lairdb Calibre 11 08-17-2016 05:49 PM
Italics, Bold, Etc. Arekuzanra Amazon Kindle 14 03-09-2014 11:01 PM
iPad "Upgraded" to iBooks 3.2 – Bold fonts are extra-bold, italics are now bold-italic MHC Apple Devices 4 03-03-2014 01:50 PM
Weird Kindle DX bug (possibly calibre related) Italics/Bold Andybaby Amazon Kindle 4 02-14-2011 09:52 AM


All times are GMT -4. The time now is 11:14 PM.


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