Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old Today, 07:48 AM   #1
ElMiko
Fanatic
ElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileRead
 
ElMiko's Avatar
 
Posts: 574
Karma: 65460
Join Date: Jun 2011
Device: Kindle Voyage, Boox Go 7
Bug: "Go to link or style" not working

I have run into an extremely strange bug (i think) where the F3 shortcut that is supposed takes you to a style doesn't actually work. And I have been struggling to replicate it except in this single instance...

In the attached file, if you go to line 28, place the cursor in the class ("vale") and hit F3, it fails to find it in the stylesheet (it just goes to the top of the stylesheet). The styling from that class is reflected in the html correctly (as far as I can tell), but it just can't find it via the F3 lookup.

EDIT: I think I may be narrowing down replication...: There are several embedded fonts. If I delete them from the stylesheet, the F3 shorcut sort of works. It jumps to the closing bracket of the class (rather than the title).

I've also noticed that F3 on the other classes will jump to the correct class, but not to the beginning of the code. For example if i F3 "calibre1", it will jump to the "calibre1" class in the stylesheet, but it'll place the cursor between the "e" and the "1" rather than at the beginning of the class in the stylesheet.

EDIT2: I've tried changing the "vale" class name (e.g. "bye", "hello") to no improved effect. However I just tried to do it on a longer class name "valeasdfasdf", and it worked the same as it would had i deleted the fonts from the stylesheet (i.e. it jumps to the closing bracket).

EDIT3: Sorry, forgot to mention, this is in Sigil 2.8.0
Attached Files
File Type: epub test - test.epub (83.9 KB, 8 views)

Last edited by ElMiko; Today at 08:02 AM.
ElMiko is offline   Reply With Quote
Old Today, 08:23 AM   #2
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: 29,489
Karma: 212177546
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
This seems to be some sort of accumulating one-off thing. If you move the vale class closer to the top of the css file, F3 finds it OK. But the cursor doesn't seem to go to the beginning of the css class.

As you move the vale class further and further down the css file, finding with F3 results in the cursor moving further and further into the class itself. Until it starts "finding" classes AFTER "vale".

Once you move vale to the end of the css file (or close to it), the F3 Find in Style feature can't position the cursor without going past the end of the file, so it bounces to the top.

I don't know why yet, but I would suspect any Find in Style search would fail to reposition to the last class in a css file of any significant length.

Doesn't seem to be a bug new to Sigil 2.8.0, thank goodness. I'm able to reproduce it in 2.7.6.

Last edited by DiapDealer; Today at 08:26 AM.
DiapDealer is online now   Reply With Quote
Advert
Old Today, 08:29 AM   #3
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: 9,699
Karma: 6774572
Join Date: Nov 2009
Device: many
Try reformatting the css to fix any errors. I often reformat to single line and then back to multiline. Then repeat your bug test. Is it still broken? Then validate your css using Doitsu's CSS Validator plugin, and report and fix any errors, then try that again.

If not, that means the bug is in the css parser we use somehow not properly parsing that file.

Last edited by KevinH; Today at 08:31 AM.
KevinH is offline   Reply With Quote
Old Today, 08:46 AM   #4
ElMiko
Fanatic
ElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileRead
 
ElMiko's Avatar
 
Posts: 574
Karma: 65460
Join Date: Jun 2011
Device: Kindle Voyage, Boox Go 7
Quote:
Originally Posted by DiapDealer View Post
Doesn't seem to be a bug new to Sigil 2.8.0, thank goodness. I'm able to reproduce it in 2.7.6.
Mmmmm, not me! 2.7.6 works just fine.


Quote:
Originally Posted by KevinH
Try reformatting the css to fix any errors. I often reformat to single line and then back to multiline. Then repeat your bug test. Is it still broken? Then validate your css using Doitsu's CSS Validator plugin, and report and fix any errors, then try that again.

If not, that means the bug is in the css parser we use somehow not properly parsing that file.
I don't know what you mean by "reformatting", but Doitsu's plugin comes back clear. And, as I said above, Sigil was perfectly capable of correctly referencing classes in 2.7.6
ElMiko is offline   Reply With Quote
Old Today, 09:14 AM   #5
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: 9,699
Karma: 6774572
Join Date: Nov 2009
Device: many
Right click in css file and select Reformat single line. Then repeat to reformat mulitiline, then repeat bug test. This will tell me if the css parser is involved somehow. I am away from my desktop machine so no way to test.
KevinH is offline   Reply With Quote
Advert
Old Today, 09:16 AM   #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: 9,699
Karma: 6774572
Join Date: Nov 2009
Device: many
If it doesn't happen with released 2.7.6 but does with released 2.8.0, that should help narrow things down if it turns out to be the css parser.
KevinH is offline   Reply With Quote
Old Today, 09:44 AM   #7
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: 29,489
Karma: 212177546
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I'm probably not running the official 2.7.6 Sigil on my laptop. It's more than likely one of the many beta builds that came after. My bad.
DiapDealer is online now   Reply With Quote
Old Today, 10:43 AM   #8
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: 29,489
Karma: 212177546
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
There's three commits that affect qCSSParser since 2.7.6. All have to do with de-nesting.
DiapDealer is online now   Reply With Quote
Old Today, 10:51 AM   #9
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: 9,699
Karma: 6774572
Join Date: Nov 2009
Device: many
Yes, That is most probably the culprit but I want to make sure it is the css parser first as it could be related to linefeed carriage issues in processing as well, since it progresses the further into the file.

If you get a chance, please try the reformat the css test to see if that fixes the issue.
KevinH is offline   Reply With Quote
Old Today, 10:55 AM   #10
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: 29,489
Karma: 212177546
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Reformatting the css made no difference in my tests.

I'll check on Linux sometime today. If the problem doesn't manifest there, a linefeed/carriage return issue is a good bet.
DiapDealer is online now   Reply With Quote
Old Today, 12:41 PM   #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: 9,699
Karma: 6774572
Join Date: Nov 2009
Device: many
It manifests on my Mac and it is an off by 1 char for every selector found before the matching class.

So strange... I will try to see where things go wrong.
KevinH is offline   Reply With Quote
Old Today, 12:52 PM   #12
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: 9,699
Karma: 6774572
Join Date: Nov 2009
Device: many
Okay, commenting out the use of the Denest code makes the problem go away, so somehow, the conversion to std::string, the running through the denester and then converting back to qstring is creating an off by one char error in calculating the position of each selector, that accumulates over the css document's length.

So very strange.
KevinH is offline   Reply With Quote
Old Today, 01:13 PM   #13
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: 9,699
Karma: 6774572
Join Date: Nov 2009
Device: many
I added some debug that captures the css input to the denester and the css outout after converting back to a QString and here are the differences:

Code:
diff -u input.txt output.txt
--- input.txt	2026-06-09 13:07:12
+++ output.txt	2026-06-09 13:06:13
@@ -14,24 +14,31 @@
     page-break-before: always;
     text-align: justify;
     }
+
 @font-face {
+
     font-family: "Helvetica Neue";
     font-style: normal;
     font-weight: normal;
     src: url(../Fonts/HelveticaNeue-Medium.otf);
     }
+
 @font-face {
+
     font-family: "Helvetica Neue";
     font-style: normal;
     font-weight: bold;
     src: url(../Fonts/HelveticaNeueBold.ttf);
     }
+
 @font-face {
+
     font-family: "Franklin Gothic Std Extra Cond";
     font-style: normal;
     font-weight: normal;
     src: url(../Fonts/FranklinGothicStd-ExtraCond.otf);
     }
+
 p {
     display: block;
     margin-top: 0;
@@ -40,6 +47,7 @@
     margin-right: 0;
     line-height: 1.15em;
     }
+
 .calibre1 {
     display: block;
     margin-bottom: 0;
@@ -49,11 +57,13 @@
     text-indent: 1.5em;
     text-align: justify;
     }
+
 blockquote {
     margin: 1em 2em;
     padding: 0;
     display: block;
     }
+
 blockquote.bqfc {
     margin: 1em auto;
     padding: 0 2em;
@@ -61,39 +71,49 @@
     width: fit-content;
     box-sizing: border-box;
     }
+
 blockquote.bqc {
     margin: 1em 0;
     padding: 0;
     display: block;
     }
+
 .bold {
     font-weight: bold;
     }
+
 .center {
     text-align: center;
     }
+
 .right {
     text-align: right;
     }
+
 .left {
     text-align: left;
     }
+
 .image {
     margin-top: 0.5em;
     margin-bottom: 0.5em;
     text-align: center;
     }
+
 .image1 {
     height: 1em;
     }
+
 .justify {
     text-align: justify;
     }
+
 .noheading {
     margin-top: 6em;
     margin-bottom: 0;
     text-align: justify;
     }
+
 .none {
     margin-top: 0;
     margin-bottom: 0;
@@ -101,14 +121,17 @@
     margin-right: 0;
     text-align: justify;
     }
+
 .separator {
     margin-bottom: 0.5em;
     margin-top: 0.5em;
     text-align: center;
     }
+
 .smc {
     font-variant: small-caps;
     }
+
 .heading1 {
     font-size: 2em;
     font-style: italic;
@@ -117,6 +140,7 @@
     margin-bottom: 1.2em;
     text-align: center;
     }
+
 .heading2 {
     font-size: 1.45em;
     font-style: italic;
@@ -124,6 +148,7 @@
     margin-bottom: 1em;
     text-align: center;
     }
+
 .hindent {
     padding-left: 1em;
     text-indent: -1em;
@@ -133,12 +158,14 @@
     margin-right: 0;
     text-align: left;
     }
+
 hr {
     border: 0;
     background-color: #000000;
     height: 4px;
     width: 85%;
     }
+
 hr.hrsep {
     border: 0;
     background-color: #000000;
@@ -147,26 +174,31 @@
     margin-top: 0.75em;
     margin-bottom: 0.75em;
     }
+
 br.brheight {
     content: " ";
     display: block;
     margin: 0.5em 0;
     }
+
 p.ra {
     float: right;
     margin-bottom: 0;
     margin-top: 0;
     text-align: right;
     }
+
 p.la {
     float: left;
     margin-bottom: 0;
     margin-top: 0;
     text-align: left;
     }
+
 div.noheight {
     line-height: 0;
     }
+
 .border {
     border-style: solid;
     border-width: 3px;
@@ -175,18 +207,21 @@
     padding-top: 2px;
     padding-bottom: 2px;
     }
+
 td.tlhs {
     margin: 0;
     padding: 0;
     text-align: left;
     vertical-align: top;
     }
+
 td.trhs {
     padding: 0 0 0 0.5em;
     margin: 0;
     text-align: left;
     vertical-align: top;
     }
+
 span.drop {
     float: left;
     font-size: 3.1em;
@@ -196,6 +231,7 @@
     margin-bottom: -0.25em;
     margin-right: 0.03em;
     }
+
 span.drop1 {
     float: left;
     font-size: 100%;
@@ -205,9 +241,11 @@
     margin-bottom: -0.25em;
     margin-right: 0.15em;
     }
+
 span.font {
     font-size: 0.8em;
     }
+
 .copyright {
     font-size: 0.9em;
     margin-top: 35%;
@@ -216,30 +254,36 @@
     padding-right: 5%;
     text-align: left;
     }
+
 .copyright1 {
     margin-top: 1.2em;
     margin-bottom: 0;
     }
+
 .cimg {
     height: 1.75em;
     vertical-align: -30%;
     }
+
 .dedic {
     margin-top: 18%;
     text-align: center;
     }
+
 .title {
     text-indent: 0;
     text-align: center;
     width: auto;
     margin: 2.5% 0 0;
     }
+
 .titleimg {
     max-width: 100%;
     max-height: 13em;
     margin: 0 auto;
     display: block;
     }
+
 .title1 {
     font-family: "Franklin Gothic Std Extra Cond";
     font-size: 3em;
@@ -247,6 +291,7 @@
     line-height: 1em;
     text-align: center;
     }
+
 .title2 {
     font-family: "Helvetica Neue";
     font-weight: bold;
@@ -255,10 +300,12 @@
     line-height: 1em;
     text-align: center;
     }
+
 .title3 {
     margin-top: 0.1em;
     text-align: center;
     }
+
 .title4 {
     font-family: "Helvetica Neue";
     font-size: 0.65em;
@@ -266,6 +313,7 @@
     line-height: 1em;
     text-align: center;
     }
+
 .title5 {
     font-family: "Helvetica Neue";
     font-size: 0.8em;
@@ -273,14 +321,20 @@
     line-height: 1em;
     text-align: center;
     }
+
 .titleimg3 {
     height: 2.75em;
     }
+
 .arthead {
     margin-bottom: 0.75em;
     text-align: center;
     }
+
 .vale {
     margin-top: 1em;
     text-align: left;
     }
+
+
+
Notice how newlines are being added in different places, some after the selector's opening { and others after the selectors closing }.

I am not sure how this change is happening, and what characters are
causing this but it at least shows me that something funny is going on.
KevinH is offline   Reply With Quote
Old Today, 01:35 PM   #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: 29,489
Karma: 212177546
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Is it me, or is the newline added immediately after the selector's opening only happening with @font-face? Other than that, all I'm seeing is a consistent newline being added after every selector's closing bracket.

Or am I missing something?

P.S. and 3 newlines at the very end (or actually 2 extra, given the one that's already consistently being added)

Last edited by DiapDealer; Today at 01:38 PM.
DiapDealer is online now   Reply With Quote
Old Today, 01:53 PM   #15
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: 9,699
Karma: 6774572
Join Date: Nov 2009
Device: many
It was a bug in the AI generated CSSDeNest.cpp that treated newlines as regular text (the correct thing) but then introduced additional newlines even when there was nothing to denest. It injected newlines differently for @ rules that should pass straight (such as @font-face) through and for normal selectors with no immediate parent (ie. not nested).

This should now be fixed in Sigil master.
KevinH is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Title Case not working on "the" "a" "in" etc mike the leg Library Management 9 11-06-2023 09:27 AM
Bug: Automater substitution of "and" with "&" in author field mikebw Library Management 2 04-15-2019 03:39 AM
"Doghouse Diaries" and "PHD Comics" not working frakman1 Recipes 0 08-22-2014 11:32 AM
Creator taking control of the "first page" link in the "content" menu cyberbaffled Kindle Formats 2 07-11-2010 04:21 PM
BUG: GUI View button not working if Author tag contains "ë" ShellShock Calibre 1 11-15-2008 01:21 PM


All times are GMT -4. The time now is 05:54 PM.


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