Menu

#84 Allow callers to get the parse tree for a page

1.3.x
closed
nobody
None
5
2012-10-11
2004-07-20
Dan F
No

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 "

"; var_dump($output); echo "
";
}
+
+ 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.

Discussion


Log in to post a comment.