2010/6/1 Conrad Irwin <conrad.irwin(a)gmail.com>om>:
The other solution is to use a proper MVC framework,
and define
everything in terms of modifications to the wikitext (and you can then
constrain what those modifications are to avoid mangling) and run that
through a parser to generate the html preview. Alternatively, if your
wikitext modifications are constrained enough, it is possible to
implement modifications as a pair of functions, one of which edits the
wikitext and the other edits the HTML (this is the method used by
English Wiktionary for the translation adding interface - and makes
undo/redo really easy). Building such a thing is time-consuming -
particularly if you have to ensure that the wikitext modification and
the HTML modification are the same - as there's a pretty large number
of things people would like to do with wikitext. That said, it's
pretty possible to use a wysiwyg for editing the contents of a
paragraph, so you could have one action for "change the content of" in
addition to actions for inserting/deleting and moving things around
(in a perfect world, a wysiwyg would trigger constrained actions based
on user-interaction - that is the "hard" part of this - the rest is
just complicated). As there's already a javascript thing for general
template arguments modifications (based on xml somehow), so this would
be extendable to work with templates too.
This is quite close to the approach we usability devs were throwing
around some time ago: constantly work with the wikitext version of the
article to avoid problems inherent in round-tripping between wikitext
and HTML. Recently, however, Trevor's been playing around with a
different concept called block-level editing; I'll leave it to him to
elaborate on that.
Roan Kattouw (Catrope)