Thread: Small Sigil bug
View Single Post
Old 09-06-2023, 12:35 PM   #8
jwes
Connoisseur
jwes began at the beginning.
 
Posts: 82
Karma: 10
Join Date: Jul 2023
Device: none
Quote:
Originally Posted by KevinH View Post
Okay from looking at your new test case:

1. clicking in Preview to sync CodeView works just fine as DNSB reported.

2. But clicking in CodeView to sync Preview, the command to scroll Preview will not be able to reach text immediately past an inline xhtml comment as the xhtml comment just does not exist in the Preview DOM tree.

I was able to "fix" this by ignoring inline xhtml comments when figuring out where to scroll Preview to. With this change, clicking in CodeView on the first "always" and clicking in CodeView on the second "always" will tell Preview to scroll to the parent p tag and not a missing inline xhtml comment. That way Preview will not skip to the "top" which is what it is supposed to do when the sync location fails.

I have pushed this change to master. It will appear in the upcoming release Sigil-2.0.0.
Running 2.0.0, if I have the code below in my HTML and click on the <hr line, it does not sync preview correctly.

<!-- Page 96 -->
<hr style="width:10%;text-align:left; margin-top: 1em;margin-left:0"/>
jwes is offline   Reply With Quote