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
This appears to be intentional from the source.. This was introduced in 8c48bd8
inlineToMediaWiki (Link txt (src, _)) = do
label <- inlineListToMediaWiki txt
case txt of
[Str s] | escapeURI s == src -> return src
_ -> return $ if isURI src
then "[" ++ src ++ " " ++ label ++ "]"
else "[[" ++ src' ++ "|" ++ label ++ "]]"
where src' = case src of
'/':xs -> xs -- with leading / it's a
_ -> src -- link to a help page
It's definitely not correct. One can see this by translating the following from mediawiki to markdown and then from markdown back to mediawiki: try [[this]] text
The intermiediate markdown text properly contains the link, for example: try [this](this "wikilink") text but the final mediawiki syntax completely loses the link and the content reverts to just plain text.
My guess is that return src was meant to be return "[[" ++ src ++ "]]"
The author's intent was to render autolinks (links whose link text == the URL) as bare URLs.
What the author left out was a test to see if the string is an absolute URL. I can fix this easily.
If I translate the following text from markdown to mediawiki: try this text
I get the following translation: try this text
I expected to receive: try [[this]] text or: try [[this|this]] text
Note, that if I translate: try this text then I do receive a proper translation of: try [[that|this]] text
This is reproducible with the online pandoc processor at http://johnmacfarlane.net/pandoc/try/
The text was updated successfully, but these errors were encountered: