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-08-2022, 09:33 AM   #46
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
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.
DiapDealer is offline   Reply With Quote
Old 08-08-2022, 10:25 AM   #47
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
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.
KevinH is offline   Reply With Quote
Old 08-08-2022, 06:00 PM   #48
un_pogaz
Chalut o/
un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.
 
un_pogaz's Avatar
 
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:
<dl>
Code:
Code:
<a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dl">&lt;dl&gt;</a>
When I select in the UI the text <dl> (containing chevon) and I try to assign a link "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dl", an error occurs.

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 "&lt;dl&gt;" but the error occur with the selected xhtml code contain any &lt; or &gt; 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.
un_pogaz is offline   Reply With Quote
Old 08-08-2022, 06:40 PM   #49
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
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 &lt;dl&gt; this text comes after </p>

</body>
</html>
Then in PageEdit if I select the text "&lt;dl&gt;" and use the Chain Link Icon and type in as the target any external url, I end up with it split out and somehow an actual dl tag is included by the editor which hides the link text and splits the preceding paragraph.

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 &lt; dl &gt; this text comes after </p>
It acts even worse when a non-existing tag name is used between the &lt; and &gt;.

For example: this leads to lost code:

Code:
  <p> This text precedes &lt;nhjdl&gt; this text comes after </p>
Attached Thumbnails
Click image for larger version

Name:	result_from_inspector.png
Views:	70
Size:	107.9 KB
ID:	195697  

Last edited by KevinH; 08-08-2022 at 07:42 PM.
KevinH is offline   Reply With Quote
Old 08-08-2022, 08:05 PM   #50
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
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!
KevinH is offline   Reply With Quote
Reply


Forum Jump

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


All times are GMT -4. The time now is 07:31 AM.


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