![]() |
#1 |
Connoisseur
![]() Posts: 77
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 |
![]() |
![]() |
![]() |
#2 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 78,986
Karma: 144284074
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.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 44,579
Karma: 168431235
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Quote:
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> 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> 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> 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> Last edited by DNSB; 05-11-2022 at 12:01 PM. |
|
![]() |
![]() |
![]() |
#4 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,680
Karma: 23983815
Join Date: Dec 2010
Device: Kindle PW2
|
I was also able to reproduce this with Sigil 1.9.2 and Sigil 0.9.8.
|
![]() |
![]() |
![]() |
#5 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,439
Karma: 5703082
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" }; 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. Last edited by KevinH; 05-11-2022 at 03:24 PM. |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Connoisseur
![]() Posts: 77
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". |
![]() |
![]() |
![]() |
#7 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,439
Karma: 5703082
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. Last edited by KevinH; 05-11-2022 at 04:10 PM. |
![]() |
![]() |
![]() |
#8 |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 44,579
Karma: 168431235
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Message deleted. Started typing and realized that @repilo had already posted what I was going to post.
|
![]() |
![]() |
![]() |
|
![]() |
||||
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 |