Setting an image as a link is broken

Bug #1051547 reported by Alistair Marshall on 2012-09-16
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

According to it should be possible to create an image as a link (near the bottom of the page)

An image [[t2t.png] as-a-link.html].

Unfortunately I have been unable to use this in RNB.

After playing around, I have found that the image source and the link are swapped, ie if you were to put [["""".png] ""path-to-image""] it does work.

I suspect it is caused by the link destination appearing before the image src path:
<a href=""><img align="middle" src="file:///home/amar/Desktop/image.png" border="0" alt=""/></a>

I suspect this may be an issue with the txt2tags code itself but am not sure.
It might be caused by the extra quotation marks that aren't shown in the origional txt2tags markup

* Tried on trunk and older versions both ubuntu and windows
* Have only tried html and preview so far, not touched plain text or latex yet.

Further update:

If the extra quotation marks are removed from the link, it works the correct way round.

AFAICT the quotation marks around the image need to remain unless it is a relative url.

> If the extra quotation marks are removed from the link, it works the correct way round.
> [[""file:///home/amar/Desktop/image"".png]]
Nice detective work ;) Could you please try if this peculiarity
(difference between using quotes and no quotes) persists in vanilla
txt2tags and report a bug at their tracker [1] if it does?


Currently having a look at doing just that.

I believe it it because txt2tags replaces the protected links with vvvRAWvvv and stores the links in the rawbank. The conversion then happens and the link locations are rearranged before the links are pasted back into the body (this time in the wrong locations).

The only way I can see to fix this would be to change the rawbank from a list to a dictionary and put an id in each vvvRAWvvv placeholder. This would be a rather large change and whilst would improve robustness of the system, it may be considered extra bloat.

This all started because I was investigating if I could set all the images in the preview to link to themselves (effectively allow you to zoom in on an image)

Jendrik Seipp (jendrikseipp) wrote :

Thanks for your investigation! This will be fixed when a new txt2tags is released and integrated into RedNotebook.

Changed in rednotebook:
status: New → Triaged
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.