Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Plugins & Atahualpa (http://forum.bytesforall.com/forumdisplay.php?f=16)
-   -   [SOLVED] Sociable plugin and XHTML Strict Validation (http://forum.bytesforall.com/showthread.php?t=3358)

cyboc Sep 9, 2009 12:38 PM

[SOLVED] Sociable plugin and XHTML Strict Validation
 
Hi I'm running Wordpress 2.8.4 with Atahualpa 3.4.1. I have had no problems until today when I installed Sociable 3.4.4. After adding the %sociable% info item to the post footer on the "Edit POST/PAGE INFO ITEMS" form, I started getting XHTML strict validation errors on http://validator.w3.org.

Here is one of the errors: document type does not allow element "ul" here. I traced that to this code snippet:
HTML Code:

<span class="sociable">
<ul>
        <li>...</li>
</ul>
</span>

If I remember my XHTML strict rules correctly, this is illegal because "span" is an inline element and "ul" is a block element. That is, you are not allowed to put a block element inside an inline element.

Instead of a "span" I think the code should generate a "div" when it is rendering the %sociable% info item.

I could be wrong though (I often am).

cyboc Sep 19, 2009 10:16 AM

FWIW, I fixed this by making some minor changes to bfa_sociable2.php.

Specifically, I changed from this:
PHP Code:

$html .= "\n<span class=\"sociable\">\n";
...
$html .= "</ul>\n</span>\n"

to this:
PHP Code:

$html .= "\n<div class=\"sociable\">\n";
...
$html .= "</ul>\n</div>\n"

As you can see, I simply changed the span element to a div element. I hope that helps someone else that doesn't like seeing XHTML validation errors. :)


All times are GMT -6. The time now is 07:14 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.