Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 12-08-2023, 11:27 PM   #181
slowsmile
Witchman
slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.
 
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
@DNSB
Quote:
"Unfortunately, the Remove empty spans option removes the span tags and leaves the content as I remember when I originally complained about <span> being removed since the span was given a default style defined in the CSS stylesheet."
So it should be easy for you to decide because you now have the option to either choose Remove empty spans or not. And so if running that option is causing you all those problems in your HTML then don't select that option.

Quote:
"The issue I'm seeing is that whether the span or other tag has a class, if it is enclosing spaces, the spaces are entirely removed but the tag is left. "
And I've already said in several previous posts that surrounding blank text spaces with those tags is wrong and is the fault of either the the person coding the html or it is the fault of the epub converter they employ. And I say aqain that my plugin doesn't fix things like that, it only tries to maintain compliance to the epub standard. In other words, this plugin is a cleanup plugin, not a fix-everything-under-the-sun plugin. OK?

Last edited by slowsmile; 12-08-2023 at 11:50 PM.
slowsmile is offline   Reply With Quote
Old 12-08-2023, 11:56 PM   #182
slowsmile
Witchman
slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.
 
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
@DNSB . . . Just to clarify -- yet again!! -- that Remove empty span is a plugin dialog option that you can choose to run or not run. That option is in the second plugin dialog at the bottom of the options list. And if running that option is causing you problems then don't use it. And the other option you have is to remove all those useless and redundant tags surrounding those blank spaces, which really serves no earthly purpose anyway and then you will be able to run the Remove empty span option without any problems.

Last edited by slowsmile; 12-09-2023 at 12:34 AM.
slowsmile is offline   Reply With Quote
Advert
Old 12-09-2023, 02:06 AM   #183
slowsmile
Witchman
slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.
 
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
@DNSB . . . This is the before code, in your last example:

Code:
<p>This is a test <span class="italic"> </span>for<span class="italic"> spaces </span>inside a tag.</p>
. . . And when I ran the plugin with no options selected I got this result:

Code:
<p>This is a test for <span class="italic">spaces</span> inside a tag.</p>
And as you can see, the plugin has removed "<span class="italic"> </span>" which is redundant and useless code that tries to style a blank space. And it's removal is correct plugin behaviour.

Last edited by slowsmile; 12-09-2023 at 02:08 AM.
slowsmile is offline   Reply With Quote
Old 12-09-2023, 02:39 AM   #184
slowsmile
Witchman
slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.
 
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
@DNSB . . . Here are some examples of correct plugin usage:

Before running the plugin:

Code:
<p><em>This is a test for correct plugin usage and behaviour.</em></p>
Code:
<p>This is a <em>test</em> for correct plugin <em>usage</em> and <em>behaviour.</em></p>
I ran the above code in an epub with no options set and the results were the same as above with no change.

Then I set the Convert <i>, <b>, <em, <u>, <s> and <strong> tags to span styling. option and ran the plugin again and got:

Code:
<p><span style="font-style: italic;">This is a test for correct plugin usage and behaviour.</span></p>
Code:
<p>This is a <span style="font-style: italic;">test</span> for correct plugin <span style="font-style: italic;">usage</span> and <span style="font-style: italic;">behaviour.</span></p>

If the tags are correctly used in html as shown above -- without surrounding blank space with tags -- then you will get a good plugin result.

Last edited by slowsmile; 12-09-2023 at 02:41 AM.
slowsmile is offline   Reply With Quote
Old 12-09-2023, 06:45 PM   #185
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: 35,464
Karma: 145525534
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by slowsmile View Post
@DNSB . . . This is the before code, in your last example:

Code:
<p>This is a test <span class="italic"> </span>for<span class="italic"> spaces </span>inside a tag.</p>
. . . And when I ran the plugin with no options selected I got this result:

Code:
<p>This is a test for <span class="italic">spaces</span> inside a tag.</p>
And as you can see, the plugin has removed "<span class="italic"> </span>" which is redundant and useless code that tries to style a blank space. And it's removal is correct plugin behaviour.
Unfortunately, when I run the plugin, the tags surrounding the blank spaces removed are not removed (see in my sample where <span class="italic"> </span> is converted to <span class="italic/> without the space. So when I preview the text, I see testfor instead of test<space>for.

In your sample, you added a space before the <span class="italic"> </span>.

My code:
Code:
This is a test<span class="italic"> </span>for
Your modification of my code:
Code:
This is a test <span class="italic"> </span>for
              ↑ note the extra space here
And while styling a space or spaces is indeed useless and redundant, it is not contrary to the ePub spec. Removing the only space separating two words is not correct behaviour.

Last edited by DNSB; 12-09-2023 at 06:49 PM.
DNSB is offline   Reply With Quote
Advert
Old 12-10-2023, 03:30 AM   #186
slowsmile
Witchman
slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.
 
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
@DSNB . . . I ran my plugin again(more than once) on the same code as you in my test epub:

<p>This is a test <span class="italic"> </span>for<span class="italic"> spaces </span>inside a tag.</p>

I even made sure to download and install the recently updated plugin(now at v0.5.5) in Sigil before running the plugin on the above code and I got this result:

<p>This is a test for <span class="italic">spaces</span> inside a tag.</p>

After plugin run please note in the result that the first <span> with blank space has been completely removed with a single blank space at the start of the second <span>. This is correct plugin behaviour.

Unfortunately, I've run all the same tests that you've run and I'm sorry but I am still unable to emulate your extra-blank-space problem when using the plugin.

I also released a new plugin update(v0.5.5) yesterday. Are you using the updated plugin?

Last edited by slowsmile; 12-10-2023 at 04:41 AM.
slowsmile is offline   Reply With Quote
Old 12-10-2023, 04:32 AM   #187
slowsmile
Witchman
slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.
 
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
@DNSB,
Quote:
"Unfortunately, when I run the plugin, the tags surrounding the blank spaces removed are not removed (see in my sample where <span class="italic"> </span> is converted to <span class="italic/> without the space. So when I preview the text, I see testfor instead of test<space>for."
Nowhere in my plugin do I deliberately convert spans containing blank spaces from this:
Code:
<span class="italic"> </span>
To a single span like this:
Code:
<span class="italic/>
I have also seen ids written written in HTML code like this:
Code:
[COLOR="Black"]<h1><a id="toc5886890"></a>CHAPTER 1</h1>
. . . which are automatically changed to this when acted upon by python's BeautifulSoup module:
Code:
[COLOR="Black"]<h1><a id="toc5886890"/>CHAPTER 1</h1>
I use the BeautifulSoup module alot in my plugin. It therefore seems that BeautifulSoup tends to automatically convert a standard double tag to single tag format if the <span> contains no actual text. I don't think I can fix that one because that problem seems to be caused by a quirk in Python's BeautifulSoup module. But as I've already mentioned in a previous post, if you simply make sure to avoid surrounding just blank spaces with <span> tags then you wouldn't have that problem would you?

Last edited by slowsmile; 12-10-2023 at 04:58 AM.
slowsmile is offline   Reply With Quote
Old 12-10-2023, 05:15 AM   #188
slowsmile
Witchman
slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.
 
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
@DNSB,

Quote:
"And while styling a space or spaces is indeed useless and redundant, it is not contrary to the ePub spec. Removing the only space separating two words is not correct behaviour. "

Well, for goodness sake, if you actually admit that styling a blank space using <span> tags is indeed a useless and pointless thing to do then why on earth are YOU doing that in your HTML code in Sigil and then insisting that it's a plugin problem?

Last edited by slowsmile; 12-10-2023 at 06:43 AM.
slowsmile is offline   Reply With Quote
Old 12-10-2023, 07:49 AM   #189
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,095
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Slowsmile: it is a client’s PROGRAM that is automatically doing this. He isn’t manually doing it…

Regardless of the cause of the styled space, he is simply saying that your plug-in is removing those styled spaces entirely.

Last edited by Turtle91; 12-10-2023 at 07:52 AM.
Turtle91 is offline   Reply With Quote
Old 12-10-2023, 02:02 PM   #190
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: 35,464
Karma: 145525534
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by slowsmile View Post
@DNSB,


Well, for goodness sake, if you actually admit that styling a blank space using <span> tags is indeed a useless and pointless thing to do then why on earth are YOU doing that in your HTML code in Sigil and then insisting that it's a plugin problem?
It may be useless and pointless but the client's software is doing it. It is valid code that does not trigger epubcheck to throw any errors. Whereas your plugin converts word<i> </i>newword to wordnewword. Substitute any tag with or without a class/style/id/whatever. I noticed the issue when a final spellcheck barfed on the document.

I see this when I run CustomCleanerPlus on an epub all by itself after clicking clear all so no options are selected.

Code:
<p>This<span class="italic" id="kofu0"> </span>is<span class="italic" id="kofu1"> </span>a<span class="italic" id="kofu2"> </span>test<span class="italic" id="kofu3"> </span>for</p>
Code:
<p>This<span class="italic" id="kofu0"/>is<span class="italic" id="kofu1"/>a<span class="italic" id="kofu2"/>test<span class="italic" id="kofu3"/>for</p>
Preview before:
This is a test for

Preview after:
Thisisatestfor


I do have a search that looks for tagged space(s) and removes the tags but your code removes the space but not the tags which is wrong in so many ways.
DNSB is offline   Reply With Quote
Old 12-10-2023, 08:50 PM   #191
slowsmile
Witchman
slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.
 
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
@DNSB,

Quote:
"I do have a search that looks for tagged space(s) and removes the tags but your code removes the space but not the tags which is wrong in so many ways. "
When I test your code with my plugin with no options set, only the <span> tags are removed and the spaces remain. See below.

Your preview before code:
Code:
<p>This<span class="italic" id="kofu0"> </span>is<span class="italic" id="kofu1"> </span>a<span class="italic" id="kofu2"> </span>test<span class="italic" id="kofu3"> </span>for</p>
After I run the plugin wiith no options set, I get:
Code:
<p>This <span class="italic" id="kofu0"/>is <span class="italic" id="kofu1"/>a <span class="italic" id="kofu2"/>test <span class="italic" id="kofu3"/>for</p>
Here is the text before preview:
This is a test for

And here is the text after preview:
This is a test for

There doesn't seem to be a problem on my side after I run the plugin in a test epub with your code.

Quote:
"I do have a search that looks for tagged space(s) and removes the tags but your code removes the space but not the tags which is wrong in so many ways. "
As I've already said, in my testing of your code the plugin removes only the <span> tags and not the space, which is correct plugin behaviour.

This has been going on for long enough and it's probably best if I end this now by saying that I am no longer interested on fixing your plugin problem. Reasons below:
  1. I can't fix your problem because I cannot emulate or reproduce your problem at my end.
  2. You are complaining that my plugin is behaving badly in spans that just surround blank spaces. As I've already said, that's poor coding and I don't care whether the code was created by you or anyone else -- you own it, so you should fix it!
  3. My "clean up" plugin is not supposed to fix poor code. The plugin should only be used or run to remove dross code and to assure EPUB compliance with some extra options for the plugin user.
  4. I have recently released and broadcast a plugin update(v0.5.5) on this thread and I've asked you -- several posts ago -- whether you were using that version or not. You didn't respond. You should be using v0.5.5. Using a different plugin version to mine might well be the reason why we are getting different results.
  5. With no options set, the plugin is designed to remove span tags that surround nothing or that surround just spaces. So if you have spaces surrounded by span tags in the html then only the span tag will automatically be unwrapped and removed because surrounding a space or spaces with a span tag serves no useful purpose. That's proper plugin behaviour by the way.
  6. I also will not fix your problem because it would probably benefit no one else but you. If I do a requested change or fix then, to make it worthwhile, I much prefer that it benefits as many people as possible and not just one person who has a singular problem that has actually been caused by someone's poor <span> coding.

Last edited by slowsmile; 12-10-2023 at 09:49 PM.
slowsmile is offline   Reply With Quote
Old 12-10-2023, 10:40 PM   #192
slowsmile
Witchman
slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.
 
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
@Turtle91,

Quote:
"Slowsmile: it is a client’s PROGRAM that is automatically doing this. He isn’t manually doing it…"
It really doesn't matter to me that @DNSB didn't actually code it manually himself. As I've already said, I don't really care whether it was another person or a converter that wrote that poor <span> code -- like it or not, @DNSB owns that code now, so he should fix it in Sigil.

And, anyway, I've already said in several previous posts, that I can't emulate or reproduce his <span> problem, so how can I fix it ???

And as I've also been saying in previous posts -- this plugin is a "clean up" plugin, not a "fix-it" plugin.

One reason @DNSB and I are getting different results with the plugin might well be because @DNSB is using a different plugin version than me. I'm currently using the most recently released v0.5.5 plugin version. And so far I've twice asked @DNSB what plugin version he is using with no response. What more can I do?

Last edited by slowsmile; 12-10-2023 at 11:12 PM.
slowsmile is offline   Reply With Quote
Old 12-10-2023, 11:49 PM   #193
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: 35,464
Karma: 145525534
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
For what it's worth, I updated to v0.5.5 when it was released. As part of my testing, I also spun up several virtual machines where I installed Sigil and CustomCleanerPlus v0.5.5. I saved an epub3 version of my test line. When I ran CustomCleanerPlus on my test epub, I got the same result on all 3. No other plugins were installed on those three VMs.

Please note that this behaviour is consistent with any of the tags I tested surrounding a space and even when I tried <div> </div> which was collapsed to <div/>.

See the attached images for the before (Mac OS Sonoma 14.1.2 only) and the post CCPlus run on all three VMs.

I still believe that removing the tags and leaving the spaces would be the correct behaviour while the actual behaviour of removing the spaces and collapsing the tags in incorrect.
Attached Thumbnails
Click image for larger version

Name:	sigil_MacOS_Sonoma_Pre.png
Views:	14
Size:	130.1 KB
ID:	205131   Click image for larger version

Name:	sigil_MacOS_Sonoma_Post.png
Views:	23
Size:	132.7 KB
ID:	205132   Click image for larger version

Name:	sigil_tumbleweed.png
Views:	15
Size:	122.7 KB
ID:	205133   Click image for larger version

Name:	sigil_windows11.png
Views:	14
Size:	102.3 KB
ID:	205134  
Attached Files
File Type: epub CCPlus_vomitus.epub (2.0 KB, 17 views)
DNSB is offline   Reply With Quote
Old 12-11-2023, 12:05 AM   #194
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: 35,464
Karma: 145525534
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Just for the heck of it, I did a bit more testing by duplicating the content of the test epub, removing the classes and ids and moving the space outside the tags. Oddly, the results were pretty much the same, the tags were collapsed and not removed.
Attached Thumbnails
Click image for larger version

Name:	sigil_blanks_pre.png
Views:	18
Size:	133.9 KB
ID:	205135   Click image for larger version

Name:	sigil_blanks_post.png
Views:	23
Size:	130.4 KB
ID:	205136  
DNSB is offline   Reply With Quote
Old 12-11-2023, 12:11 AM   #195
slowsmile
Witchman
slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.
 
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
@DNSB,

When I ran the plugin with no options on this simplified code:

Code:
<p>This <span> </span>is a test for</p>
After plugin run, I had this result:

Code:
<p>This <span/>is a test for</p>
In the code, notice that <span> </span> has been converted from a double tag span entity to this <span/>, which is a useless and redundant single tag span entity that does nothing. But interestingly, the test EPUB still passed Epubcheck, even though that single tag span is redundant and useless code.

And as I've also described in a previous post -- it's probably my use of python's BeautifulSoup(BS) module that's causing the double span tag with blank space to convert to single span tag format with no blank space. And nowhere in my BeautifulSoup code am I deliberately trying to convert to single tag format.

So, unfortunately, I can't fix the above problem -- because it's a BeautifulSoup problem.

I tried another simple test to confirm my findings. I added a horizontal rule with a blank space to the EPUB like this:

Code:
<hr> </hr>
Then I ran my plugin and BeautifulSoup changed the above line to:

Code:
<hr/>
. . .to single tag format - just like the span tag with blank space.

And just to clarify that the above span problem seems to be normal BeautifulSoup
behaviour for any tag like <a>, <hr> or <span> that contains just a blank space.

And, like I've said, I can't fix that problem if the cause is inside python's BeautifulSoup module. So your only option appears to be to manually remove all of those useless single tag span entities in Sigil using search and replace.

Last edited by slowsmile; 12-11-2023 at 12:32 AM.
slowsmile is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[FileType Plugin] YVES Bible Plugin ClashTheBunny Plugins 27 01-16-2023 01:25 AM
Problem with my ScrambleEbook plugin and the Plugin Updater tool jackie_w Development 14 01-19-2017 10:49 PM
Plugin not customizable: Plugin: HTML Output does not need customization flyingfoxlee Conversion 2 02-24-2012 02:24 AM
[GUI Plugin] Plugin Updater **Deprecated** kiwidude Plugins 159 06-19-2011 12:27 PM
New Plugin Type Idea: Library Plugin cgranade Plugins 3 09-15-2010 12:11 PM


All times are GMT -4. The time now is 05:55 AM.


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