Syncing codeview and preview windows
I am trying to write a plugin to fix typos found on an e-reader. I am using PySide6 and have a QPlainTextEdit widget for the source and a QWebEngineView widget for a preview. The input is a list of phrases around the typo from the e-reader. The first problem is finding the phrase in the html source (there may be invisible html). My thought is using bs4.get_text() but then I have to find the equivalent source location. Any suggestions?
The second problem is syncing the preview window to the code window. I tried reading the Sigil source, but it is not clear to me how it works. Can someone explain it?
|