Mediawiki WikiSyntax

I finally had some time to dig into the syntax-definition format and build a syntax for Mediawikis WikiSyntax.

WikiSyntax is fairly complex and some of the elements can’t be properly matched using only regular expressions, but it is good enough to highlight most cases. Complex template code and tables might break it though.

I used [[ for inserting the title of drafts with a wiki tag. << triggers auto-completion for some common html tags (interestingly, using just < made drafts crash reliably when inserting two tags in the same line). {{ will trigger completion for magic words.

List indicators (* and #) are tappable to increase the nesting level. (I wanted to add this for headings, but tasks can’t add content at the end of the line).

It’s certainly not perfect, but very usable. Maybe someone else can use it.

(Using the wiki apis to load and save articles you can transform drafts into a pretty capable wiki editor.)


Can you help me here: Linking text within a draft?