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

MediaWiki parser and [[file:...] for an image (lower case f) #9424

Closed
peterjc opened this issue Feb 7, 2024 · 1 comment
Closed

MediaWiki parser and [[file:...] for an image (lower case f) #9424

peterjc opened this issue Feb 7, 2024 · 1 comment
Labels

Comments

@peterjc
Copy link

peterjc commented Feb 7, 2024

Example MediaWiki snippet tested on https://en.wikipedia.org/

These render the image in-line:

A: [[File:Felis_silvestris_silvestris_small_gradual_decrease_of_quality.png]]

B: [[file:Felis_silvestris_silvestris_small_gradual_decrease_of_quality.png]]

C: [[Image:Felis_silvestris_silvestris_small_gradual_decrease_of_quality.png]]

D: [[Image:Felis_silvestris_silvestris_small_gradual_decrease_of_quality.png]]

These render as links to the image (often used for PDF files):

E: [[Media:Felis_silvestris_silvestris_small_gradual_decrease_of_quality.png]]

F: [[media:Felis_silvestris_silvestris_small_gradual_decrease_of_quality.png]]

Explain the problem.
Include the exact command line you used and all inputs necessary to reproduce the issue. Please create as minimal an example as possible, to help the maintainers isolate the problem. Explain the output you received and how it differs from what you expected.

$ echo "
> These render the image in-line:
> 
> A: [[File:Felis_silvestris_silvestris_small_gradual_decrease_of_quality.png]]
> 
> B: [[file:Felis_silvestris_silvestris_small_gradual_decrease_of_quality.png]]
> 
> C: [[Image:Felis_silvestris_silvestris_small_gradual_decrease_of_quality.png]]
> 
> D: [[Image:Felis_silvestris_silvestris_small_gradual_decrease_of_quality.png]]
> 
> These render as links to the image (often used for PDF files):
> 
> E: [[Media:Felis_silvestris_silvestris_small_gradual_decrease_of_quality.png]]
> 
> F: [[media:Felis_silvestris_silvestris_small_gradual_decrease_of_quality.png]]
> 
> 
> " | pandoc -f mediawiki -t gfm
These render the image in-line:

A:
![](Felis_silvestris_silvestris_small_gradual_decrease_of_quality.png "Felis_silvestris_silvestris_small_gradual_decrease_of_quality.png")

B:
<file:Felis_silvestris_silvestris_small_gradual_decrease_of_quality.png>

C:
![](Felis_silvestris_silvestris_small_gradual_decrease_of_quality.png "Felis_silvestris_silvestris_small_gradual_decrease_of_quality.png")

D:
![](Felis_silvestris_silvestris_small_gradual_decrease_of_quality.png "Felis_silvestris_silvestris_small_gradual_decrease_of_quality.png")

These render as links to the image (often used for PDF files):

E:
[Media:Felis_silvestris_silvestris_small_gradual_decrease_of_quality.png](Media:Felis_silvestris_silvestris_small_gradual_decrease_of_quality.png "wikilink")

F:
[media:Felis_silvestris_silvestris_small_gradual_decrease_of_quality.png](media:Felis_silvestris_silvestris_small_gradual_decrease_of_quality.png "wikilink")

Example B, with file in lower case, failed to be interpreted as an embedded image.

The examples on https://www.mediawiki.org/wiki/Help:Images only use the title-case version, so usage ought to be rarer?

See also #3052

Pandoc version?

Testing on macOS, now using:

$ pandoc --version
pandoc 3.1.3
Features: +server +lua
Scripting engine: Lua 5.4
User data directory: /Users/pc40583/.local/share/pandoc
Copyright (C) 2006-2023 John MacFarlane. Web: https://pandoc.org
This is free software; see the source for copying conditions. There is no
warranty, not even for merchantability or fitness for a particular purpose.

Was using:

$ pandoc --version
pandoc 2.19.2
Compiled with pandoc-types 1.22.2.1, texmath 0.12.5.2, skylighting 0.13,
citeproc 0.8.0.1, ipynb 0.2, hslua 2.2.1
Scripting engine: Lua 5.4
User data directory: /Users/pc40583/.local/share/pandoc
Copyright (C) 2006-2022 John MacFarlane. Web:  https://pandoc.org
This is free software; see the source for copying conditions. There is no
warranty, not even for merchantability or fitness for a particular purpose.

(same behaviour)

@peterjc
Copy link
Author

peterjc commented Feb 7, 2024

Super fast - I did try to work out where the fix would be, but couldn't see how the case was handled. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant