View Single Post
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,654
Karma: 5433388
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:	88
Size:	112.3 KB
ID:	193770  

Last edited by KevinH; 05-11-2022 at 03:24 PM.
KevinH is offline   Reply With Quote