From: Dan F. <dfr...@cs...> - 2004-07-20 13:15:19
|
Reini, For some of our work, I found the desire to grab the parse tree from BlockParser. This, I added a function TransformTextPre() that will give me the parse tree. I submitted a patch (https://sourceforge.net/tracker/index.php?func=detail&aid=994487&group_id=6121&atid=306121), also shown below. I'd be happy to apply it if you approve. Dan This patch adds a function called TransformTextPre() which returns a parse tree, suitable for climbing around in. diff -b -u -r1.1.1.2 BlockParser.php --- BlockParser.php 14 Apr 2004 21:22:31 -0000 1.1.1.2 +++ BlockParser.php 20 Jul 2004 13:11:31 -0000 @@ -1013,7 +1013,10 @@ //////////////////////////////////////////////////////////////// // -function TransformText ($text, $markup = 2.0, $basepage=false) { +/* + * Transform the text of a page, and return a parse tree. + */ +function TransformTextPre ($text, $markup = 2.0, $basepage=false) { if (isa($text, 'WikiDB_PageRevision')) { $rev = $text; $text = $rev->getPackedContent(); @@ -1035,6 +1038,16 @@ if (0 && DEBUG && check_php_version(5)) { echo "<pre>"; var_dump($output); echo "</pre>"; } + + return $output; +} + +/* + * Transform the text of a page, and return an XmlContent, + * suitable for printXml()-ing. + */ +function TransformText ($text, $markup = 2.0, $basepage=false) { + $output = TransformTextPre($text, $markup, $basepage); if ($basepage) { // This is for immediate consumption. |