Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 08-21-2018, 06:34 PM   #1
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
[Bug] HTML Comments in Preview

Versions

Sigil 0.9.10
Windows 10 - 64 bit

(Haven't tested on other OSes or older versions of Sigil)

The Bug

Attached is a sample EPUB.

Let's say you have an HTML file in Code View with an HTML comment in it:

Spoiler:
Code:
<p>Paragraph 1</p>
<p>Paragraph 2</p>
<p>Paragraph 3</p>
<p>Paragraph 4</p>
<p>Paragraph 5</p>
<p>Paragraph 6</p>
<p>Paragraph 7</p>
<p>Paragraph 8</p>
<p>Paragraph 9</p>
<p>Paragraph 10</p>
<p>Paragraph 11</p>
<p>Paragraph 12</p>
<p>Paragraph 13</p>
<p>Paragraph 14</p>

<!--Comment 15-->

<p>Paragraph 15</p>

<p>Paragraph 16</p>
[...]

<p>Paragraph 100</p>


Preview window syncs to each location fine... until you place your cursor on the line With/After the HTML comment on it.

Preview jumps all the way to the top of the file, instead of staying in the vicinity of the nearest <p>.

If you press Line 24, Preview is fine:

Click image for larger version

Name:	BugLine24.png
Views:	177
Size:	8.9 KB
ID:	165779

If you press anywhere in Line 25/26, Preview jumps to the top:

Click image for larger version

Name:	BugLine25.png
Views:	178
Size:	8.1 KB
ID:	165780

Code:
<p>Paragraph 14</p>|Fine
|Fine
<!--Comment 15-->|JumpsToTop
|JumpsToTop
<p>Paragraph 15</p>|Fine
|Fine
<p>Paragraph 16</p>|Fine
[...]
<p>Paragraph 29</p>|Fine
<!-- Comment 30-->|JumpsToTop
<p>Paragraph 30</p>|Fine
What you expect is:

Code:
<p>Paragraph 14</p>|Fine
|Fine
<!--Comment 15-->|StaysSameAsP14
|StaysSameAsP14
<p>Paragraph 15</p>|Fine
|Fine
<p>Paragraph 16</p>|Fine
[...]
<p>Paragraph 29</p>|Fine
<!-- Comment 30-->|StaysSameAsP29
<p>Paragraph 30</p>|Fine
Attached Files
File Type: epub PreviewHTMLCommentsTest.epub (2.0 KB, 144 views)
Tex2002ans is offline   Reply With Quote
Old 08-21-2018, 07:20 PM   #2
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,644
Karma: 5433388
Join Date: Nov 2009
Device: many
Yes comments are not actually considered tags inside a node tree in Preview and instead are special text nodes, so extracting a webpath to s comment will result in its parent block tag being used.

Try clicking on an actual tag not a text node.
KevinH is offline   Reply With Quote
Old 08-22-2018, 01:10 AM   #3
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
I was working on a book yesterday with lots of HTML Comments.

Usually I'm staring at Preview + clicking around in Code View out of the corner of my eye (mousewheel,click mousewheel,click)... and it was just awful having Preview constantly jumping up top.

It also occurred while I was using Find/Replace or spellchecking with Preview open. Imagine:

Code:
[...]
<p>Sample coed</p>
<!-- This is some coed for an HTML Comment ->
<p>And when will I learn how to spell code correctly in my coed.</p>
I was pulling my hair out with how often Preview was jumping to the top of the file.

Note: I just tested my example EPUB in Calibre's Editor, and Calibre acts as expected (no jumping).

Quote:
Originally Posted by KevinH View Post
Try clicking on an actual tag not a text node.
Also would be helpful to keep in mind for users who aren't able to accurately click the mouse, or those using the keyboard to navigate. (I know a few users on MobileRead have injured hands).
Tex2002ans is offline   Reply With Quote
Old 08-22-2018, 03:21 PM   #4
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,644
Karma: 5433388
Join Date: Nov 2009
Device: many
Are you talking about clicking in Preview and having CodeView sync closely to a comment that is near that point you clicked (which is what I thought when I first read your post and replied about) or are you clicking in or on a comment in html and watching what Preview does. If it is the latter, then Preview is syncing to the parent tag of the text field/comment which in your example is the body tag. If just use arrow keys or click down one line in CodeView, Preview should happily resync automatically after a short delay. There might be a way to move to the previous sibling tag, but that is not how the code is actually designed nor how Sigil generates html paths currently.
KevinH is offline   Reply With Quote
Old 08-22-2018, 04:48 PM   #5
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by KevinH View Post
Are you talking about clicking in Preview and having CodeView sync closely to a comment that is near that point you clicked (which is what I thought when I first read your post and replied about) or are you clicking in or on a comment in html and watching what Preview does.
Clicking in Code View.

Quote:
Originally Posted by KevinH View Post
If just use arrow keys or click down one line in CodeView, Preview should happily resync automatically after a short delay.
And that's the issue. Preview will happily sync to the top of the file if the cursor is on an HTML Comment (Line 25/42) or the blank line after (Line 26).
Tex2002ans is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Searching in comments for html-tags Kuhnke Calibre 1 05-23-2017 09:33 PM
Posible but at html comments Terisa de morgan Library Management 8 07-05-2016 07:22 AM
How do I paste description (comments) without the html formatting? webipsum Calibre 5 07-15-2014 07:38 PM
Calibre Companion V3.1 HTML Comments chaley Calibre Companion 34 09-15-2013 09:22 AM
Syncing bug in preview window sellew Sigil 13 02-26-2013 01:10 PM


All times are GMT -4. The time now is 07:25 PM.


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