You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think the issue with the link you gave is caused by the the img tag embedded by the a tag
I managed to fix both problems by splitting the two tags in the html.
So for example, your link will become
<ahref="/vorratsdatenspeicherung" hreflang="de"></a><imgsrc="/sites/default/files/styles/medium_crop/public/2017-09/fsa-unschuldsvermutung_%20John-Paul_Bader_cc-by-sa2.jpg?itok=CQntlFzw" width="410" height="208" alt="John-Paul Bader, CC BY SA 2.0" loading="lazy" typeof="foaf:Image" class="image-style-medium-crop">
Notice that the </a> that used to enclose the two together is now moved between the beginning of the img tag. So now that the two is seperated. And Pandoc will convert them to
As you can see there are two links, [[/vorratsdatenspeicherung][]]
and [[/sites/default/files/styles/medium_crop/public/2017-09/fsa-unschuldsvermutung_%20John-Paul_Bader_cc-by-sa2.jpg?itok=CQntlFzw]]
The first link is invalid because it has an empty description and org will intepret it as a normal text while the second, on the other hand, is perfectly normal.
I found the way to fix the empty description by, as you may have guessed, insert a new description into the html.
I've implemented this in the fix-linked-images branch of my fork. I've only tested this for a few days with wikipedia articles and it works quite well but I still need to do more tests.
I'll be making a pull request when it's ready.
alphapapa
changed the title
handle links in images
handle images in links
Dec 20, 2023
@c1-g i tried out your branch, it works well for relative links to files and images.
i also noticed another issue, which perhaps you could address?
(it is in the main branch too, but maybe you have such knowhow?)
html like, this (an image that is also a link):
renders into a kind of hyperactivated org link
i.e. it generates two links, one from
href=
and one fromimg src=
, with mangled square brackets.The text was updated successfully, but these errors were encountered: