Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 05-11-2022, 10:35 AM   #1
repilo
Enthusiast
repilo began at the beginning.
 
Posts: 42
Karma: 10
Join Date: Apr 2021
Location: Spain
Device: Kobo Libra 2
Prettify removes space between bold an italic inside figcaption

Hello:
When I apply right-click->"Reformat HTML->Mend and prettify Code" the space between a bold text and an italic text inside a figcaption is removed. For example:

<figcaption><b>Figure 2:</b> <i>Text

is converted to:

<figcaption><b>Figure 2:</b><i>Text


Using Sigil 1.8.0
Thanks
repilo is offline   Reply With Quote
Old 05-11-2022, 11:03 AM   #2
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,660
Karma: 127838196
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Unless you are using version 1.9.2, and you have the same problem, this is never going to be fixed in an old version like you are using.
JSWolf is offline   Reply With Quote
Advert
Old 05-11-2022, 11:58 AM   #3
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 34,557
Karma: 144552660
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by JSWolf View Post
Unless you are using version 1.9.2, and you have the same problem, this is never going to be fixed in an old version like you are using.
Jon, it would be much preferred if you actually tested this under 1.9.2 before posting.

Code:
  <figure>
    <img src="../Images/elephant.jpg" alt="Elephant at sunset" class="width90"/>

    <figcaption><b>Figure 2: </b> <i> An elephant at sunset</i></figcaption>
  </figure>
After 1.9.2 prettify:

Code:
  <figure>
    <img src="../Images/elephant.jpg" alt="Elephant at sunset" class="width90"/>

    <figcaption><b>Figure 2: </b><i> An elephant at sunset</i></figcaption>
  </figure>
Added <p></p> tags and prettify:

Code:
  <figure>
    <img src="../Images/elephant.jpg" alt="Elephant at sunset" class="width90"/>

    <figcaption><p><b>Figure 2: </b> <i> An elephant at sunset</i></p></figcaption>
  </figure>
And yes, prettify using 1.92 does remove the space between the </b> and the <i>. OTOH, only a single space shows when the test is displayed though other characters do. Wrapping the text in <p></p> tags will prevent that space from being removed though any string of 2 or more spaces will still be reduced to a single space.

Code:
  <figure>
    <img src="../Images/elephant.jpg" alt="Elephant at sunset" class="width90"/>

    <figcaption><p><b>Figure 2: </b>   a         b      c     d    ee       fff<i> An elephant at sunset</i></p></figcaption>
  </figure>
only shows one space between the alpha characters in the preview pane. See attached image.
Attached Thumbnails
Click image for larger version

Name:	elephant.png
Views:	86
Size:	308.5 KB
ID:	193768  

Last edited by DNSB; 05-11-2022 at 12:01 PM.
DNSB is offline   Reply With Quote
Old 05-11-2022, 01:00 PM   #4
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,582
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by DNSB View Post
After 1.9.2 prettify:

Code:
  <figure>
    <img src="../Images/elephant.jpg" alt="Elephant at sunset" class="width90"/>

    <figcaption><b>Figure 2: </b><i> An elephant at sunset</i></figcaption>
  </figure>
[...]
I was also able to reproduce this with Sigil 1.9.2 and Sigil 0.9.8.
Doitsu is offline   Reply With Quote
Old 05-11-2022, 02:03 PM   #5
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,506
Karma: 5433350
Join Date: Nov 2009
Device: many
But the bold string ends with a space. Multiple whitespace in html is condensed to one space. So the prettified version and the unprettified version should show as identical in an ereader and Preview.

I just checked this:

Under Prevew, both before and after prettifying the image is identical. Nothing changed that impacts layout. See testcase.png that is attached.

So I am not convinced this is a bug at all.

As it stands, adding "figcaption" to the list of other text holder tags in Parsers/GumboInterface.cpp is enough to make it keep that space.

Code:
diff --git a/src/Parsers/GumboInterface.cpp b/src/Parsers/GumboInterface.cpp
index 45ab4e49..4847c162 100644
--- a/src/Parsers/GumboInterface.cpp
+++ b/src/Parsers/GumboInterface.cpp
@@ -84,7 +84,7 @@ static std::unordered_set<std::string> structural_tags     = {
 
 
 static std::unordered_set<std::string> other_text_holders = {
-    "address","caption","dd","div","dt","h1","h2","h3","h4","h5","h6",
+    "address","caption","dd","div","dt","figcaption","h1","h2","h3","h4","h5","h6",
     "legend","li","option","p","td","th","title"
 };
But I am not sure that is any more correct that what Sigil does now.

So this would be change with no valid reason for making one as far as I can tell.

Arguments one way or the other appreciated.
Attached Thumbnails
Click image for larger version

Name:	testcase.png
Views:	84
Size:	112.3 KB
ID:	193770  

Last edited by KevinH; 05-11-2022 at 03:24 PM.
KevinH is offline   Reply With Quote
Advert
Old 05-11-2022, 03:51 PM   #6
repilo
Enthusiast
repilo began at the beginning.
 
Posts: 42
Karma: 10
Join Date: Apr 2021
Location: Spain
Device: Kobo Libra 2
The space is kept in:

<figcaption><b>Figure 2: </b><i>Text

and in:

<figcaption><b>Figure 2:</b><i> Text

But the space disappears here in:

<figcaption><b>Figure 2:</b> <i>Text


joining the two words, "Figure2:Text".
repilo is offline   Reply With Quote
Old 05-11-2022, 03:56 PM   #7
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,506
Karma: 5433350
Join Date: Nov 2009
Device: many
Yes,
That last one is a definite bug. I will push the change to add figcaption to the list of other text holders. This change will appear in the next release. Hopefully around the first weekend in June or shortly thereafter.

Thanks for clarifying things.

Until then, Using Find and Replace to wrap the contents of figcaption in a p tag before prettifying should work as a temporary stop-gap.

Quote:
Originally Posted by repilo View Post
The space is kept in:

<figcaption><b>Figure 2: </b><i>Text

and in:

<figcaption><b>Figure 2:</b><i> Text

But the space disappears here in:

<figcaption><b>Figure 2:</b> <i>Text


joining the two words, "Figure2:Text".

Last edited by KevinH; 05-11-2022 at 04:10 PM.
KevinH is offline   Reply With Quote
Old 05-11-2022, 06:35 PM   #8
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 34,557
Karma: 144552660
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Message deleted. Started typing and realized that @repilo had already posted what I was going to post.
DNSB is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Italic/bold not showing Phssthpok Editor 3 02-05-2019 10:48 AM
Best way to do italic and bold bookman156 ePub 166 04-09-2016 03:43 PM
Using italic and bold instead of emphasis and strong hardbound ePub 12 05-24-2014 07:20 AM
iPad "Upgraded" to iBooks 3.2 – Bold fonts are extra-bold, italics are now bold-italic MHC Apple Devices 4 03-03-2014 01:50 PM
italic, bold etc to normal cybmole Sigil 11 03-04-2011 10:37 AM


All times are GMT -4. The time now is 12:45 AM.


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