public
Last active

  • Download Gist
gistfile1.php
PHP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
/* Copyright: http://textile.thresholdstate.com/ */
 
function span($text)
{
$qtags = array('\*\*','\*','\?\?','-','__','_','%','\+','~','\^');
$pnct = ".,\"'?!;:";
 
foreach($qtags as $f) {
$text = preg_replace_callback("/
(?:^|(?<=[\s>$pnct])|([{[]))
($f)(?!$f)
({$this->c})
(?::(\S+))?
([^\s$f]+|\S[^$f\n]*[^\s$f\n])
([$pnct]*)
$f
(?:$|([\]}])|(?=[[:punct:]]{1,2}|\s))
/x", array(&$this, "fSpan"), $text);
}
return $text;
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.