08-21-2018, 06:34 PM | #1 |
Wizard
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:
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: If you press anywhere in Line 25/26, Preview jumps to the top: 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 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 |
08-21-2018, 07:20 PM | #2 |
Sigil Developer
Posts: 7,620
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. |
08-22-2018, 01:10 AM | #3 |
Wizard
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> Note: I just tested my example EPUB in Calibre's Editor, and Calibre acts as expected (no jumping). 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). |
08-22-2018, 03:21 PM | #4 |
Sigil Developer
Posts: 7,620
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.
|
08-22-2018, 04:48 PM | #5 | |
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
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). |
|
Thread Tools | Search this Thread |
|
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 |