[Moin-user] Hints to modify parser for emphasis markup (Bold, Italic)

Daniel Cox dc at microbits.com.au
Sat Jun 12 18:12:50 EDT 2004


Moin Moin looks great, however the main struggle I am having with most Wiki software is the markup.

My non-technical users have been using *bold* in email for years - and we have many TWiki documents in that format. The fact that '''lots of quotes''' has almost become standard is not enough to convice users. *bold* even works in MS Word!

HTML Markup as provided by some Wiki's is definately not an option. <b>bold</b> is much harder for users to understand.

I am new to Python, could you please provide some hints on how I could modify the default parser to accept: *bold* and _italic_ - there is an extension listed, the BizarreStructuredText which would do this but it is not available for download.

The 2 expressions that handle this in TWiki are:

# PTh 25 Sep 2000: More relaxed rules, allow leading '(' and trailing ',.;:!?)'
s/([\s\(])\*([^\s]+?|[^\s].*?[^\s])\*([\s\,\.\;\:\!\?\)])/$1<strong>$2<\/strong>$3/g;
s/([\s\(])_([^\s]+?|[^\s].*?[^\s])_([\s\,\.\;\:\!\?\)])/$1<em>$2<\/em>$3/g;

It should be simple to add an expression like this to the long list in the default parser.

Thanks for any help you may be able to provide.
Daniel.





More information about the Moin-user mailing list