Having trouble with Textile PHP parser for MarkItUp

885 views Asked by At

I've created a Jekyll based blog using Textile markdown, and I was working on creating an editor using Markitup I am having a heck of a time getting the php textile parser to work so I can see the preview. I've downloaded the Textile Official PHP Parser, and just can't seem to figure it out.

I've found numerous examples on how to use Markdown but examples for using Textile seem to be a little slim.

Here is the code to use Markdown:

<?php
include_once "markdown.php";
$html=Markdown($_POST['data']);
echo htmlentities($html); \
?>

And the example.php from the Textile Official PHP Parser:

<?php
require_once('classTextile.php');
$textile = new Textile();
$in = <<<EOF
A *simple* example.
EOF;
echo $textile->TextileThis($in);
?>

And this is what I've clobbered together on my own:

<?php
require_once ('classTextile.php');
$textile = new Textile();
echo $textile->TextileThis($_POST['data']);
?>

Could someone tell me what I'm doing wrong here? Would be very grateful for any help, I normally don't code websites, I just keep the servers running :)

Thanks!!

1

There are 1 answers

0
4wd22r On

Answer, just in case anyone else is looking for this, the last example I posted:

<?php
require_once ('classTextile.php');
$textile = new Textile();
echo $textile->TextileThis($_POST['data']);
?>

Works perfectly, just as long as your path is part of open_basedir

derp.