On Mon, May 2, 2011 at 3:32 PM, Platonides <Platonides(a)gmail.com> wrote:
If we can
devise a way to consistently treat expansions that *aren't* a
hierarchical match fro the HTML node tree, then we might not have to
change
templates much. If we can't, then we might
have to start enforcing
hierarchical template & other code nesting and go through and migrate a
bunch of existing templates.
{{Open template}} text {{Close template}} structures are IMHO a big
problem for any WYSIWYG editor.
But there's no way they are going away.
If we determine they have to go, then we can devise ways to find and migrate
them -- it'll be a process that takes time and a lot of helper tools, and
it's necessary to not underplay that difficulty.
But it's not an intractable problem. Essentially, anything in the format:
{{start}}
content1
content2
{{end}}
can be rewritten something like:
{{container|
content1
content2
}}
with some variation based on what needs there are on customizing the
start/end and such. That could then expand cleanly:
template: 'container'
param 0:
'content1'
'content2'
->
expanded-template: 'container'
table:
row:
'start'
row:
cell:
'content1'
'content2'
row:
'end'
Now, it may well be feasible to actually let the table rows just sit there
in the parse tree and coalesce them into the adjacent table during final
HTML transformation or something, but if that's not practical to do in the
parser & translation layers it shouldn't be impossible to migrate.
Where wrapping bunches of things in separate rows is done currently, some
basic (and sane) loop parser functions could also help with making those
clean.
-- brion