*/ require_once(dirname(__FILE__) . '/textilephp/Textile.php'); /** * DrupalTextile is a subclass of MTLikeTextile that properly handles * Textile footnote URL fragments in a Drupal context. */ class DrupalTextile extends MTLikeTextile { /** * Creates a new DrupalTextile object using the provided options. * * @param $options * The array specifying the options for this object. */ function DrupalTextile($options = array()) { parent::MTLikeTextile($options); } /** * Formats the provided URL, properly handling URL fragments in a * Drupal context. * * @param $args * The array specifying the URL with key "url". * * @return * A string containing the formatted URL. */ function format_url($args) { if (preg_match('<^#>', $args['url'])) { $args['url'] = $_GET['q'] . $args['url']; } $args['url'] = ($args['url'] ? url($args['url']) : ''); return parent::format_url($args); } } ?>