View Single Post
Old 08-13-2014, 08:52 PM   #802
Rev. Bob
Wizard
Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.
 
Rev. Bob's Avatar
 
Posts: 1,760
Karma: 9918418
Join Date: Feb 2013
Location: Here on the perimeter, there are no stars
Device: Kobo H2O, iPad mini 3, Kindle Touch
Quote:
Originally Posted by JSWolf View Post
What gets removed and in what instances? Thanks.
Well, let's see:

Quote:
Originally Posted by Rev. Bob View Post
I [...] also add[ed] BIG and SMALL to the list of elements that the two "strip" routines will remove if they lack both content and attributes. (In other words, the 8/1 code would remove <b/> but not <small/>; today's code will remove both.)
"What gets removed" - from memory, the element list is A, B, I, U, EM, SPAN, STRONG, and now BIG and SMALL.

"In what instances" - if they lack both content and attributes, just as the example shows and just as the code did before. The only change I made was to add BIG and SMALL to that list...exactly as I said above.

<b>blah</b> - not affected (has content).
<b class="blah"/> - not affected (has attribute).
<b class="foo">bar</b> - not affected (has both).
<b/> - removed.
<b></b> - turned into <b/> and then removed.

It's that simple.

None of the listed elements have any effect on the document if they have neither content nor attributes, so stripspans and stripkobo remove them as being bloated, useless code. While it is true that some ebook formatters may choose to style those elements in such a way that their absence will affect the book's display, the same is true of <span> with no attributes; it's possible but unwise. (And that's why you should always keep a backup before applying a plugin, anyway.)
Rev. Bob is offline   Reply With Quote