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
[[Category:Name]] --> part of category "Name" (used in some outputs from pandoc)
[[Category:Name|Sort]] --> part of category "Name" using sort key "Sort" in place of page title
[[:Category:Help]] --> link with text "Category:Help"
[[:Category:Help|Help category]] link with text "Help category"
Try converting this to RST using pandoc v1.17.0.2 (Mac OS X),
$ echo "This page is in [[Category:Example]] and here is a link to the [[:Category:Help|Help category]], and an [http://example.org external site] too." | pandoc -f mediawiki -t rst
This page is in and here is a link to the `Help
category <:Category:Help>`__, and an `external
site <http://example.org>`__ too.
Or, to HTML,
$ echo "This page is in [[Category:Example]] and here is a link to the [[:Category:Help|Help category]], and an [http://example.org external site] too." | pandoc -f mediawiki -t html
<p>This page is in and here is a link to the <a href=":Category:Help" title="wikilink">Help category</a>, and an <a href="http://example.org">external site</a> too.</p>
<p><a href="Category:Example" class="uri" title="wikilink">Category:Example</a></p>
The unsupported tag [[Category:Example]] is dropped here (fine - see comment below using markdown output). The external link to http://example.org is perfect.
The bug is the URL used for the "Help Category". This is Category:Example in HTML which breaks (see below), but :Category:Example in the RST which is worse - notice Mediawiki's special syntax leading colon is still there.
Due to the special URL scheme notation, this URL should be presented as Category%3AExample where the colon is %3A, as otherwise the browser seems to interpret this as a (undefined) URL scheme (like http://example.org or https://example.org or here category:...).
The text was updated successfully, but these errors were encountered:
Pandoc does handle the category tag in markdown output, e.g.
$ echo "This page is in [[Category:Example]] and here is a link to the [[:Category:Help|Help category]], and an [http://example.org external site] too." | pandoc -f mediawiki -t markdown_github-hard_line_breaks
This page is in and here is a link to the [Help
category](:Category:Help "wikilink"), and an [external
site](http://example.org) too.
<Category:Example>
As an aside, clearly my example should not really have put the MediaWiki [[Category:Example]] mid sentence.
Note that the same URL problem is shown here too.
peterjc
added a commit
to peterjc/mediawiki_to_git_md
that referenced
this issue
Apr 10, 2016
There is an overlapping/related issue with linking to user pages, and any other MediaWiki special pages with a colon in their name, e.g.
$ echo "This was written by [[User:pjc|Peter]]." | pandoc -f mediawiki -t markdown_github-hard_line_breaks
This was written by [Peter](User:pjc "wikilink").
In order to prevent the browser trying to interpret this as a URL scheme user:, it seems simplest to escape the colon in the URL:
This was written by [Peter](User%3Apjc "wikilink").
Referring to https://www.mediawiki.org/wiki/Help:Categories in mediawiki,
[[Category:Name]]
--> part of category "Name" (used in some outputs from pandoc)[[Category:Name|Sort]]
--> part of category "Name" using sort key "Sort" in place of page title[[:Category:Help]]
--> link with text "Category:Help"[[:Category:Help|Help category]]
link with text "Help category"Try converting this to RST using pandoc v1.17.0.2 (Mac OS X),
Or, to HTML,
The unsupported tag
[[Category:Example]]
is dropped here (fine - see comment below using markdown output). The external link to http://example.org is perfect.The bug is the URL used for the "Help Category". This is
Category:Example
in HTML which breaks (see below), but:Category:Example
in the RST which is worse - notice Mediawiki's special syntax leading colon is still there.Due to the special URL scheme notation, this URL should be presented as
Category%3AExample
where the colon is%3A
, as otherwise the browser seems to interpret this as a (undefined) URL scheme (likehttp://example.org
orhttps://example.org
or herecategory:...
).The text was updated successfully, but these errors were encountered: