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

Org to mediawiki: File links with colons #2713

Closed
marcbowes opened this issue Feb 14, 2016 · 2 comments
Closed

Org to mediawiki: File links with colons #2713

marcbowes opened this issue Feb 14, 2016 · 2 comments

Comments

@marcbowes
Copy link

In Org, if I have this:

[[file:User:Me/about][About]]

Then it becomes this after being converted to mediawiki:

[User:Me/about About]

It should have become:

[[User:Me/about About]]

The "User:Me" example is used because that is the common practice for user pages in mediawiki.

@tarleb
Copy link
Collaborator

tarleb commented Apr 27, 2016

I currently maintain the org reader, sorry for not getting back to you earlier. This is an instance of the general impedance mismatch between markup languages. Mediawiki allows a nice way to write and distinguish between external and wiki links. This isn't the case in markup languages designed for more general (i.e. non-wiki) use. Gitit/Pandoc use the convention of empty links [[][User:me/about]] to allow for wiki links. I'm not aware of a way to write wiki links with labels different from the wiki page they link to.

@tarleb
Copy link
Collaborator

tarleb commented May 18, 2017

I'm unsure how the org reader should behave here. I see two solutions: 1. allow wikilink: to be used as a special URI schema and add wikilink as a link title (similar to how the MediaWiki reader behaves), or 2. leave as is and leave this kind of processing to filters, which should be fairly easy to write. My preference is on the first idea, although this should be hidden behind an extension.

However, there is another issue here: using the MediaWiki reader and writer, [[User:about/me|About]] becomes [User:about/me About], thus just changing the org reader won't fix the problem. I'm not too familiar yet with MediaWiki markup but will look into this.

tarleb added a commit to tarleb/pandoc that referenced this issue May 19, 2017
MediaWiki wikis frequently have pages with names like `User:John` which
were interpreted as URIs, thus turning internal links into global links.
This is prevented by also checking whether the scheme of a URI is
frequently used (i.e. is IANA registered or an otherwise well-known
scheme).

Fixes: jgm#2713
tarleb added a commit to tarleb/pandoc that referenced this issue May 22, 2017
API change: the function `isURI`, testing if a string is a valid URI
with a known scheme, is exported from the Shared module, as is the set
of known `schemes`.

The new function replaces the function of the same name
from *Network.URI*, as the latter did not check whether a scheme is
well-known.  E.g. MediaWiki wikis frequently feature pages with names
like `User:John`. These links were interpreted as URIs, thus turning
internal links into global links. This is prevented by also checking
whether the scheme of a URI is frequently used (i.e. is IANA registered
or an otherwise well-known scheme).

Fixes: jgm#2713
tarleb added a commit to tarleb/pandoc that referenced this issue May 22, 2017
API change: the function `isURI`, testing if a string is a valid URI
with a known scheme, is exported from the Shared module, as is the set
of known `schemes`.

The new function replaces the function of the same name
from *Network.URI*, as the latter did not check whether a scheme is
well-known.  E.g. MediaWiki wikis frequently feature pages with names
like `User:John`. These links were interpreted as URIs, thus turning
internal links into global links. This is prevented by also checking
whether the scheme of a URI is frequently used (i.e. is IANA registered
or an otherwise well-known scheme).

Fixes: jgm#2713
tarleb added a commit to tarleb/pandoc that referenced this issue May 22, 2017
API change: the function `isURI`, testing if a string is a valid URI
with a known scheme, is exported from the Shared module, as is the set
of known `schemes`.

The new function replaces the function of the same name
from *Network.URI*, as the latter did not check whether a scheme is
well-known.  E.g. MediaWiki wikis frequently feature pages with names
like `User:John`. These links were interpreted as URIs, thus turning
internal links into global links. This is prevented by also checking
whether the scheme of a URI is frequently used (i.e. is IANA registered
or an otherwise well-known scheme).

Fixes: jgm#2713
@jgm jgm closed this as completed in 5debb0d May 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants