08-08-2022, 09:33 AM | #46 |
Grand Sorcerer
Posts: 27,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
We still need to determine what the original text looks like and if the characters are indeed angle brackets. We also need to determine if they're inserting the link via a PageEdit feature dialog (which should probably handle the conversion of these characters to entities automatically). PageEdit IS a wysiwyg editor after all.
|
08-08-2022, 10:25 AM | #47 |
Sigil Developer
Posts: 7,644
Karma: 5433388
Join Date: Nov 2009
Device: many
|
And if being used alone (without Sigil) then PageEdit's Inspector can show the before and after underlying code.
FYI: I have had no trouble with properly xml escaped "<" and ">" signs being used as targets (selected text) for Insert Hyperlink (ie. the chain link icon) in PageEdit. So that appears to work just fine as far as my testing shows. I also tried inserting a "<" and ">" into a link id target in the Select Target dialog and it properly detected that inappropriate character and issued an error and refused to insert the link and nothing was lost. So this appears to just work for me. Are you sure you are using the latest version of PageEdit? Are the chevron unicode chars you referred to x203A and x2039? If so, are they properly utf-8 encoded in theu derlying xhtml file? So help on how to recreate what you are seeing is needed. Last edited by KevinH; 08-08-2022 at 04:31 PM. |
08-08-2022, 06:00 PM | #48 | |
Chalut o/
Posts: 410
Karma: 145324
Join Date: Dec 2017
Device: Kobo
|
Okay, so let's be very specific:
This case is impossible to do via the UI. Text: Quote:
Code:
<a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dl"><dl></a> I admit that I was really light in my description, it seemed simple to me to describe, oops. So: 1. Exactly what does the xhtml code look like before the insertion? The code before insertion is "<dl>" but the error occur with the selected xhtml code contain any < or > at any location in the selection. 2. Where in the xhtml text is the insertion cursor when trying to insert a link? I didn't push very far but as it happens inside a simple <p> direct child of <body>, I think I can say with confidence: Anywhere. 3. Are they actual Chevrons or the xhtml escaped chars that indicate a tag (ie the less than < and greater than >)? Yes, the chevrons are propely escaped in the target xhtml code. 4. Exactly what code is "lost"? All the left text for only selected a >. All the right text for only selected a <. The text inside a chevron paire, bonus, the paragraph are broken into 2 at the position of the paire. 5. Is it actually lost or just xml escaped and so does not appear? The lost text is realy lost. It is no longer present at any level of the file (visual and code). Oh, in doubt, I reinstalled PageEdit, the bug persists. |
|
08-08-2022, 06:40 PM | #49 |
Sigil Developer
Posts: 7,644
Karma: 5433388
Join Date: Nov 2009
Device: many
|
Okay I can recreate some strange behaviour:
Code:
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops"> <head> <title></title> </head> <body> <p>*</p> <p> This text precedes <dl> this text comes after </p> </body> </html> See the image below for how things look in PageEdit's Inspector after inserting the link. So no text is lost in this case. Inserting a single space around the dl makes everything work: ie. Code:
<p> This text precedes < dl > this text comes after </p> For example: this leads to lost code: Code:
<p> This text precedes <nhjdl> this text comes after </p> Last edited by KevinH; 08-08-2022 at 07:42 PM. |
08-08-2022, 08:05 PM | #50 |
Sigil Developer
Posts: 7,644
Karma: 5433388
Join Date: Nov 2009
Device: many
|
Okay, the issue is QtWebEngineView selectedText() returns the xml decoded string so before re-inserting it (when adding the link) we need to make it xml safe as it was in the underlying xhtml file.
I have now fixed this in PageEdit master but the code in question is used for many many things so I am worried my fix may have some unexpected side effects. We will need to spend some time testing things before actually releasing it. I can point you at the change if you build your own. Thanks for the bug report! |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
PageEdit-1.7.0 Released | DiapDealer | Sigil | 1 | 07-22-2021 11:44 AM |
PageEdit-1.6.0 Released | DiapDealer | Sigil | 10 | 07-08-2021 12:34 PM |
PageEdit-1.5.0 Released | DiapDealer | Sigil | 1 | 03-19-2021 10:59 AM |
PageEdit-1.2.0 Released | DiapDealer | Sigil | 13 | 04-02-2020 04:16 AM |
PageEdit-0.8.0 Released | DiapDealer | Sigil | 37 | 08-25-2019 04:14 PM |