So everything works fine when I try to use this with any non-Lightbox preset. But when I select a Lightbox preset for my insert, the code comes through mangled. This is using a TinyMCE editor, so there are two versions that get inserted.

Rich Text Disabled

<a rel="lightbox[group1][<br /><br /><a href="http://yosemitespace.com/sites/default/files/imagecache/product_full/caldera-cutaway.jpg" target="_blank" id="lightbox2-download-link-text">Download Original</a>]" href="http://yosemitespace.com/sites/default/files/imagecache/product_full/caldera-cutaway.jpg"><img src="http://yosemitespace.com/sites/default/files/imagecache/product_list/caldera-cutaway.jpg" alt="" title="" class="imagecache-product_list" /></a>

So somehow it's ending up with nested A tags

Rich Text Endabled
Here it inserts the same code, but the embedded BR and A tags get converted so that the brackets get converts to entities. It looks like this
<a id="lightbox2-download-link-text" rel="lightbox[group1][&lt;br &gt;&lt;/a&gt;&lt;br /&gt;&lt;a href=" href="http://yosemitespace.com/sites/default/files/imagecache/product_full/caldera-cutaway.jpg" target="_blank">Download Original</a>]" href="http://yosemitespace.com/sites/default/files/imagecache/product_full/caldera-cutaway.jpg"&gt;<img class="imagecache-product" src="http://yosemitespace.com/sites/default/files/imagecache/product/caldera-cutaway.jpg" alt="" />

Comments

ergophobe’s picture

PS, this is with all Input Filters disabled except the Lightbox filter.

quicksketch’s picture

Status: Active » Postponed

I don't use Lightbox, so it's unlikely that I'll be taking a look at this problem. Any patches appreciated.

ergophobe’s picture

Status: Postponed » Active

So when I'm in insert.js and setting some breakpoints in firebug, at line 41, the content property has the value

"<a rel="lightbox[group1][__description__<br /><br /><a href="http://yosemitespace.com/sites/default/files/imagecache/product_full/caldera-cutaway.jpg" target="_blank" id="lightbox2-download-link-text">Download Original</a>]" href="http://yosemitespace.com/sites/default/files/imagecache/product_full/caldera-cutaway.jpg"><img src="http://yosemitespace.com/sites/default/files/imagecache/uc_thumbnail/caldera-cutaway.jpg" alt="__alt__" title="__title__" class="imagecache-uc_thumbnail" /></a> "

By the time I get down to line 61, it's got the value given in my original post

"<a rel="lightbox[group1][<br /><br /><a href="http://yosemitespace.com/sites/default/files/imagecache/product_full/caldera-cutaway.jpg" target="_blank" id="lightbox2-download-link-text">Download Original</a>]" href="http://yosemitespace.com/sites/default/files/imagecache/product_full/caldera-cutaway.jpg"><img src="http://yosemitespace.com/sites/default/files/imagecache/uc_thumbnail/caldera-cutaway.jpg" alt="" title="" class="imagecache-uc_thumbnail" /></a> "

That is to say, it has stripped the "__description__".

abaddon’s picture

i think this is related to http://drupal.org/node/479310#comment-2188954 and http://drupal.org/node/613946 (where this feature got added), shouldnt the bug be moved there? i think the markup is generated using lightbox2/lightbox2-insert-image.tpl.php

ergophobe’s picture

Thanks - this seems to be fixed with the latest release and dev versions of Lightbox2, released on Sept 24

#613946: Add neccessary hooks to work with Insert module

ergophobe’s picture

Status: Active » Closed (duplicate)
ergophobe’s picture

Status: Closed (duplicate) » Active

My mistake. This is actually not fixed with the latest releases of Lightbox2

quicksketch’s picture

Title: Mangled HTML when using Lightbox2 Preset » Mangled HTML when using Lightbox2 Insert Preset
Project: Insert » Lightbox2
Version: 6.x-1.0-beta6 » 6.x-1.10

Moving over to LB2.

toomanypets’s picture

I'm having the same problem:

Lightbox2 6.x-1.x-dev (2010-Sep-24)
Insert 6.x-1.0-beta6

toomanypets’s picture

This appears to be related to, or perhaps duplicate of, #830092: Insert module Download original.

toomanypets’s picture

As a work-around until this issue is addressed, without hacking the code, you can set the "Text for image original link:" to blank under Text Settings on admin/settings/lightbox2.

This is the text that will appear as the link to the original file underneath the image in the lightbox. Leave this blank for the link not to appear. It will only appear for images uploaded via the "image" or "imagefield" modules. Users will need the "download original image" permission, but also the "view original images" permission if using the "image" module.
ergophobe’s picture

Status: Active » Closed (duplicate)