|
|
#1 |
|
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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 Last edited by ElMiko; Today at 08:02 AM. |
|
|
|
|
|
#2 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
|
|
|
| Advert | |
|
|
|
|
#3 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
|
|
|
|
|
#4 | ||
|
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 574
Karma: 65460
Join Date: Jun 2011
Device: Kindle Voyage, Boox Go 7
|
Quote:
Quote:
|
||
|
|
|
|
|
#5 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
|
|
|
| Advert | |
|
|
|
|
#6 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
|
|
|
|
|
#7 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
|
|
|
|
|
#8 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
|
|
|
|
|
#9 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
|
|
|
|
|
#10 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
|
|
|
|
|
#11 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
|
|
|
|
|
#12 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
|
|
|
|
|
#13 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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;
}
+
+
+
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. |
|
|
|
|
|
#14 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
|
|
|
|
|
#15 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
|
|
|
![]() |
|
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 |