Prior to installing AddThis, my site validated correctly. It seems that you are using a div inside a link (a href) which is not valid. The W3C validator also tells me: there is no attribute "border". and there is no attribute "target".. It would be great if you could change the HTML output to standards compliance. Thanks!

Comments

Richard Blackborder’s picture

I'm using the 6.x version myself, but I notice that border="0" for that version comes from the "Button image HTML attributes" option in the administer settings. If that's the case in 5.x, you could try changing it to a style="border:none;" section or whatever validates.

mlondon77’s picture

It's a great module, but I'm having the same problem. The error message I get is:

==================

Column 134: document type does not allow element "div" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag .

…lass="addthis" style="display:inline">

addthis_ The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element. One possible cause for this message is that you have attempted to put a block-level element (such as "

" or "

") inside an inline element (such as "", "", or ""). ==================================== Any help on how to fix this? Thanks.
vesapalmu’s picture

Assigned: Unassigned » vesapalmu
Status: Active » Needs review
StatusFileSize
new785 bytes

I just commited a new version to CVS that changes default HTML attributes to alt="". New version has also slightly different implementation of hook_link so that it does not generate extra href=#" link any more. These changes fix problems with border and missing alt attribute.

In order to fix the problem with div tag a span tag should be removed around AddThis div. This could be done by creating a custom theming function for links or by modifying function theme_links directly in theme.inc. Personally I would like to see theme.inc modified a bit, since now it adds a span just for adding extra HTML attributes even when there are none.

If you want to make a quick and dirty fix to solve the issue you can patch Drupal core (6.3) with attached patch. I'll try to get this patch included to core.

vesapalmu’s picture

Status: Needs review » Closed (works as designed)

This will not be fixed in core. To fix this issue in the future addthis button will be moved from links to node content.

mgifford’s picture

Version: 5.x-1.2 » 6.x-2.x-dev
StatusFileSize
new1023 bytes

Well, yeah, but why worry about taking out the span in core when you can remove the div in the module?

Seems to work fine here without it - http://openconcept.ca/blog/mgifford/quick_accessibility_patch_accepted_i...

It's just got to output this instead:

    <a href="http://www.addthis.com/bookmark.php"
      onmouseover="return addthis_open(this, '', '[URL]', '[TITLE]')"
      onmouseout="addthis_close()"
      onclick="return addthis_sendto()"><img src="http://s9.addthis.com/button1-share.gif" width="125" height="16" alt="Share Page with Add This Button" /></a>
    <script type="text/javascript" src="http://s7.addthis.com/js/152/addthis_widget.js"></script>

Unless the div is needed for some strange Safari hack or something like that, why is it there? Works fine in firefox & opera on the mac.

I've provided a small patch to remove the div tags that are inserted by this module. With this patch it validates because you're not mix/matching spans & divs.

vesapalmu’s picture

Status: Closed (works as designed) » Needs review

Thank you for the patch! I am positive that this will make it's way to the module soon.

mgifford’s picture

Good to hear. It's a useful module. Much easier to find screen real estate for this icon rather than a row of other buttons.

vesapalmu’s picture

Status: Needs review » Fixed

This has now been committed to CVS.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.