[Pmwiki-users] DevQ: Intercept action=edit / preview / post

Steven Leite steven_leite
Fri Apr 30 22:50:56 CDT 2004


I've been experimenting with a light-weight wysiwyg editor.  Rather than
changing the core-behaviour of the editor, I was thinking of writing /
modifying a Cookbook extension to TRANSLATE the HTML that is received
from the editor.

I think using regexpr and $InlineReplacements this won't be too terribly
difficult, but I'm having a hard time intercepting the $text.

I need to intercept the text before PmWiki saves it.  I need to apply
the replacements, and covert all the HTML code to WikiCode.

Also, when the edit page link is initially clicked, there is not yet any
preview, so the HTML output is not yet available.

Essentially I am wondering about refining or rewriting PmWiki's current
functionality that converts the WikiMarkup to HTML.

It would be nice to have two simple functions to draw upon:

1) ConvertWikiToHtml($text); (returns $html)
2) ConvertHtmlToWiki($html); (returns $wikitext)

I would also need to get the $html output on the first edit (instead of
doing subsequent preview to get the $preview_text so it's available for
the wysiwyg editor).

Comments, suggestions, help, all graciously accepted.  I'm a bit over my
head here in the programming dept., but I just couldn't resist.  I see
future Wiki's using a strictly wysiwyg interface, and dispensing
completely with the ancient wiki-markup that most Wikis currently use.
Until that time however, I'm trying this ideai.

-S




More information about the pmwiki-users mailing list