Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Block images from markdown have the additional word "caption" in their captions, and size is ignored. #5105

Closed
qwazix opened this issue Nov 27, 2018 · 0 comments

Comments

@qwazix
Copy link

qwazix commented Nov 27, 2018

Version

pandoc 1.19.2.4
Compiled with pandoc-types 1.17.0.5, texmath 0.9.4.4, skylighting 0.3.3.1

Description

Conversion of block element images from markdown to mediawiki produces captions that have the word "caption" prepended to them. Additionally their size designation is redundant and ignored by MediaWiki.

Input

![InSight lander on Mars (artist concept)](PIA22745-Mars-InSightLander-ArtistConcept-20181030.jpg){width=800}

Output

[[File:PIA22745-Mars-InSightLander-ArtistConcept-20181030.jpg|frame|none|800px|alt=|caption InSight lander on Mars (artist concept)]]

This is a screenshot of the rendering of this mediawiki snippet
screenshot_2018-11-27 editing insight section - wikipedia

And this is the caption. Notice the word caption in front. It is clearly not a label and should not be there.

image

Expected Output

[[File:PIA22745-Mars-InSightLander-ArtistConcept-20181030.jpg|thumb|none|800px|alt=|InSight lander on Mars (artist concept)]]

Steps to Reproduce

Create a file named wiki.md with the content described in "Input" above and convert to mediawiki with this command

pandoc wiki.md -t mediawiki -o output.wiki

Inspect output.wiki

Notes

Block level images with a size designation should translate to thumb instead of frame as in mediawiki images in frames ignore the size.

This is quite significant as currently the only way to get functioning wiki pages from markdown is to resize the images, which has it's own set of problems since it loses compatibility with HiDPI displays and the possibility to have a larger image when the user clicks. Thus I argue that the correct fix would be to modify block images to be thumbs instead of framed.

@jgm jgm closed this as completed in 77a40d6 Nov 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant