Argon-Dokuwiki-Template icon indicating copy to clipboard operation
Argon-Dokuwiki-Template copied to clipboard

All local pdf links are display:flex, preventing inline links

Open alexforencich opened this issue 4 years ago • 3 comments

Placing a link to a local PDF results in the link class being set to media, which is display: flex. This means it is impossible to have an inline link to a local PDF (as far as I can tell, anyway) as display:flex causes line breaks both before and after the link. What is the best way to fix that? I can just delete the display: flex line in the css file, but maybe there is another option that makes more sense.

alexforencich avatar Apr 29 '20 06:04 alexforencich

Thanks. I'll look into it today.

IceWreck avatar Apr 29 '20 13:04 IceWreck

I added this to the stylesheet

.mf_pdf {
    display: inline;
}

I guess this needs to be done for other formats as well which are recognized by dokuwiki but unlike images there is no preview.

IceWreck avatar Apr 29 '20 16:04 IceWreck

I just took a peek at the dokuwiki documentation. There is a ?linkonly option that can be added to embedded media links, presumably to remove the preview. However, if I add that to the pdf links, they are still showing up display: flex. This also appears to be the case for image links, which similarly prevents inlining the links.

I did notice something interesting, though: images seem to appear with class "media" only, but the PDF links and images with ?linkonly seem to appear with classes "media", "mediafile", and "mf_something". So maybe mediafile should override display:flex with display:inline. Or perhaps display:flex should only apply to "img" tags or other embed tags but not the "a" tag.

alexforencich avatar Apr 29 '20 20:04 alexforencich