According to the venerable principles of the WikiWay, markup rules should be simple. And most of the time, wiki engine developers try to keep it simple. But deep inside, they know it is not. There is a darker secret waiting down there, in the darkness.

Wiki markup is based on punctuation and whitespace, trying to mimic the pseudo markup of early email. Just like smileys are abstract representations of faces, some of these rules such as *bold* and /italic/ try to associate what you see with what you get. WYSIWYG – what you see is what you guessed, ideally. Most of the time, such simple rules that try to do the right thing automatically have hideously complex implementations underneath.

Why? HTML tags can be nested this way or that way, there are inline elements and block elements, and implicit markup that relies on punctuation and whitespace instead of tags is a do-what-i-mean trade-off. It seems simpler at first but gets complicated if you want to really "hack" it. Just think of the original ''italic'' and '''bold''' rule. What happens here: '''''italic and bold''''' or ''strange '''and beautiful''''' nesting, '''terrifying to ''explain''''' to newbies. The same is true for 100km/h or 150m/h on days like 09/12/2004. What is /italic and what is *not?*

The byzantine complexity of some of the nesting rules and regular expressions is currently best left as a dark mysterious core – a tabu, if you want. That is the cause for the cognitive dissonance and the resulting frustration. Ideally, the rules would be simple. But they are not.



When working on a new wiki engine, choosing from the WikiMarkupStandard and adding your own rules to the mix, think about the documentation you want to write. Think about the nesting of tags. Think about allowed punctuation or non-ASCII characters inside some of the tags. Think about explaining it to newcomers. And then simplify your proposal.

Or, accept byzantine complexity and know that the rules will sometimes work and sometimes not. Accept that some fiendish users will hack your rules and produce unexpected results. You might like it or not. The fact is that your markup rules will turn out to be brittle as the most insignificant change you make will break some of the pages your hackers have written.


EditNearLinks: WikiMarkupStandard