1
0
mirror of synced 2024-12-15 15:46:02 +03:00
doctrine2/manual/lib/Text/Wiki/Render/Latex/Phplookup.php

39 lines
1008 B
PHP
Raw Normal View History

2007-09-01 03:38:43 +04:00
<?php
class Text_Wiki_Render_Latex_Phplookup extends Text_Wiki_Render {
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
$text = trim($options['text']);
// take off the final parens for functions
if (substr($text, -2) == '()') {
$q = substr($text, 0, -2);
} else {
$q = $text;
}
$formatObj = $this->wiki->formatObj[$this->format];
// toggg 2006/02/05 page name must be url encoded (e.g. may contain spaces)
$q = $formatObj->escape_latex($this->urlEncode($q));
$text = $formatObj->escape_latex($text);
return '\texttt{' . $text . '}\footnote{\url{http://php.net/' . $q . '}}';
}
}
?>