On Fri, May 6, 2011 at 12:11 PM, Brion Vibber <brion(a)pobox.com> wrote:
I'm having some trouble adapting the RTELinker
class, which adds annotation
to some link & header structures and removes the table of contents; now that
these base Linker functions have moved to static methods on the Linker class
(with a back-compatibility magic forward from Skin instance methods) there's
no way to replace them by passing in a custom skin with overrides -- Parser
and friends call Linker directly so don't see the custom code.
Some of them I can adapt existing hooks for, but I may need to add a couple
more hooks.
This gets a little scarier-looking once it turns out that the core Parser
class has a hojillion little patches on it that the extension depends on,
which do much of the annotation & placeholder insertion. I should be able to
refactor most of those into either hooks or more cleanly-factored Parser
methods that can be subclassed more directly in RTEParser; that'll make the
extension's integration job a lot easier on a stock 1.18.
Whee!
Well one thing's for sure -- I'm going to have spent a lot more time looking
at the guts of the current parser before this is done. ;)
It's also definitely reminding me why I don't like our current parser code.
;) But a lot of it can be made cleaner and more extensible I think without
any behavior changes, which gets us a long way in the short term.
-- brion