[pmwiki-users] Converting WikiStyle shortcuts to CSS classes
russell-pmwiki at saberpunk.net
Sun Sep 11 16:06:53 CDT 2005
The main weakness of my Rich Text Editor's current implementation is
WikiStyles. The problem is that, while I can preserve the effects of
the styles just fine, saving them back to their original markup gets
complicated. For example, if I do %define=box block bgcolor=#ddddff%,
then apply it to several pieces of text on a page, those pieces of text
end up with %backgroundcolor=#ddddff% on each of them. The same thing
happens with built-in (or otherwise programmatically defined) styles- I
can get the effect, but not the name.
I think the most sensible way to get around this is to transform
WikiStyles into the thing they act like- CSS classes. I'm figuring
that, at the end of markup generation, I'd transform the contents of
$WikiStyles to classes and store them in $HTMLStylesFmt['wikistyles'].
I have a few questions:
* Is there a reason not to do this? Previously, Pm has said there
wasn't, but I want to make sure nobody's run into one.
* Has anyone played with rewriting the WikiStyle engine before? Have
you documented any design or quirks?
* Has anyone done a list of the variables used inside by and inside
All in all, it doesn't look like too big a job, and I imagine the
results could be useful in other contexts. Any comments or help would
More information about the pmwiki-users