Markdown plugin rendering WikiText links?

I’ve got some Markdown content that I’ve imported into my wiki. The Markdown plugin has some configuration options around also rendering WikiText, which looks like it does what I need – I’d like [[Square Bracket Links]] to be linked.

renderWikiText is set to “true”, and renderWikiTextPragma has a default value:

\rules only html image macrocallinline syslink transcludeinline wikilink filteredtranscludeblock macrocallblock transcludeblock

Transclusion with {{Some Tiddler Title}} works. A macro transclude with the #inc-plugin works.

It says wikilink there, but links aren’t being linkified. Is there something special I need to do / can I enable WikiText linking in the Markdown plugin?

2 Likes

Does it work when it’s on it’s own line? My information may be dated, but I seem to recall that wikitext inside of markdown only worked when it was on it’s own line. But maybe there’s been some improvements since then.

Only wikilinks seem to not work – macros and transclusion work fine, whether on their own line or not.

Just tried it, and syslinks link correctly, too. This feels like a setting somewhere…

Hmm, I just tried the official demo: https://tiddlywiki.com/plugins/tiddlywiki/markdown/

And if CamelCase is turned on … it will link that. But it won’t link [[wikilinks]].

I have solved it before, try this: https://gist.github.com/Gk0Wk/6fb9e3a20fb7c52224c60e18e1402b52

Overwrite the $:/plugins/tiddlywiki/markdown/wrapper.js tiddler.

1 Like

That did it, thank you!

Should we file an issue for this? That wikilink parsing code in the gist you linked works, but I imagine this is a bug in core code that needs upgrading. Especially the CamelCase linking does.

Sounds like a bug. @Sttot might you be able to make a PR?

Markdown parser of tw5 is based on Remarkable.js, a general Markdown-render library, so there’s no reason for it to recognize wikilink format. And I just attach a remarkable plugin (remarkable-wikilink on npmjs.com) to it.

@boris @jeremyruston Well, I have no idea whether this is a bug for tw5 because wikilink is indeed not a syntax supported by markdown. I can make a PR but I’m worried that some people do not like this feature enhancement.

We added support for parsing Markdown text runs with the wikitext parser (renderWikiText = true), and as far as I know that mode is intended to support TW5-style linking.

Yeah, this is my understanding. There’s a bug in the core logic somewhere. I filed an issue:

Stott’s code is wedged in at the Markdown layer, not in the WikiText parsing, so that’s where the bug is / fix would need to go.

1 Like