06-07-2018, 09:28 AM | #1 |
Chalut o/
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. |
06-07-2018, 11:10 AM | #2 |
Well trained by Cats
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 |
Advert | |
|
06-07-2018, 03:58 PM | #3 |
mostly an observer
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? |
06-07-2018, 05:09 PM | #4 |
Guru
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> 4. Press Ctrl-I or press "Italic" button from toolbar (to enable italic) Code:
<p>o<i>k</i></p> 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 |
06-07-2018, 06:37 PM | #5 | ||
Grand Sorcerer
Posts: 5,583
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
Quote:
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. |
||
Advert | |
|
06-07-2018, 07:02 PM | #6 |
Sigil Developer
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 |
06-07-2018, 09:05 PM | #7 |
Hedge Wizard
Posts: 800
Karma: 19999999
Join Date: May 2011
Location: UK/Philippines
Device: Kobo Touch, Nook Simple
|
|
06-08-2018, 08:16 AM | #8 | |
Sigil Developer
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:
Last edited by KevinH; 06-08-2018 at 08:19 AM. |
|
06-08-2018, 08:24 AM | #9 |
Grand Sorcerer
Posts: 27,546
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
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.
|
06-08-2018, 09:29 AM | #10 |
Grand Sorcerer
Posts: 5,583
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
|
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.)
|
06-08-2018, 10:11 AM | #11 |
Sigil Developer
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.
|
06-08-2018, 10:57 AM | #12 |
Grand Sorcerer
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. |
06-08-2018, 11:20 AM | #13 |
Grand Sorcerer
Posts: 5,583
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
|
Unfortunately, I also managed to crash the Linux version of Sigil using your method. I.e., the problem also affects other operating systems.
|
06-08-2018, 11:25 AM | #14 | |
Grand Sorcerer
Posts: 27,546
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
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. |
|
06-08-2018, 11:56 AM | #15 | |
Groupie
Posts: 171
Karma: 3517858
Join Date: May 2016
Location: Monterrey, Mexico
Device: Samsung Tab-3 7"
|
Quote:
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. |
|
|
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 |