Lines Matching +refs:text +refs:line
277 function TextileThis($text, $lite='', $encode='', $noimage='', $strict='', $rel='') argument
286 $text = $this->incomingEntities($text);
287 $text = str_replace("x%x%", "&", $text);
288 return $text;
292 $text = $this->cleanWhiteSpace($text);
295 $text = $this->getRefs($text);
298 $text = $this->block($text);
301 $text = $this->retrieve($text);
304 $text = str_replace("<br />", "<br />\n", $text);
306 return $text;
311 function TextileRestricted($text, $lite=1, $noimage=1, $rel='nofollow') argument
320 $text = $this->encode_html($text, 0);
322 $text = $this->cleanWhiteSpace($text);
323 $text = $this->getRefs($text);
326 $text = $this->blockLite($text);
329 $text = $this->block($text);
332 $text = $this->retrieve($text);
335 $text = str_replace("<br />", "<br />\n", $text);
337 return $text;
413 function hasRawText($text) argument
416 …im(preg_replace('@<(p|blockquote|div|form|table|ul|ol|pre|h\d)[^>]*?>.*</\1>@s', '', trim($text)));
422 function table($text) argument
424 $text = $text . "\n\n";
426 array(&$this, "fTable"), $text);
461 function lists($text) argument
463 … return preg_replace_callback("/^([#*]+$this->c .*)$(?![^#*])/smU", array(&$this, "fList"), $text);
469 $text = explode("\n", $m[0]);
470 foreach($text as $line) {
471 $nextline = next($text);
472 if (preg_match("/^([#*]+)($this->a$this->c) (.*)$/s", $line, $m)) {
480 $line = "\t<" . $this->lT($tl) . "l$atts>\n\t\t<li>" . $this->graf($content);
482 $line = "\t\t<li>" . $this->graf($content);
485 if(strlen($nl) <= strlen($tl)) $line .= "</li>";
488 $line .= "\n\t</" . $this->lT($k) . "l>";
490 $line .= "</li>";
495 $out[] = $line;
520 function block($text) argument
525 $text = explode("\n\n", $text);
530 foreach($text as $line) {
532 if (preg_match("/^($tre)($this->a$this->c)\.(\.?)(?::(\S+))? (.*)$/s", $line, $m)) {
542 $line = $o1.$o2.$content.$c2;
544 $line = $o1.$o2.$content.$c2.$c1;
549 if ($ext or !preg_match('/^ /', $line)) {
550 … list($o1, $o2, $content, $c2, $c1) = $this->fBlock(array(0,$tag,$atts,$ext,$cite,$line));
553 $line = $content;
556 $line = $o2.$content.$c2;
560 $line = $this->graf($line);
564 $line = $this->doPBr($line);
565 $line = preg_replace('/<br>/', '<br />', $line);
568 $out[count($out)-1] .= "\n".$line;
570 $out[] = $line;
640 function graf($text) argument
644 $text = $this->noTextile($text);
645 $text = $this->code($text);
648 $text = $this->links($text);
650 $text = $this->image($text);
653 $text = $this->lists($text);
654 $text = $this->table($text);
657 $text = $this->span($text);
658 $text = $this->footnoteRef($text);
659 $text = $this->glyphs($text);
660 return rtrim($text, "\n");
664 function span($text) argument
670 $text = preg_replace_callback("/
679 /x", array(&$this, "fSpan"), $text);
681 return $text;
714 function links($text) argument
728 /Ux', array(&$this, "fLink"), $text);
734 list(, $pre, $atts, $text, $title, $url, $slash, $post) = $m;
742 $text = $this->image($text);
744 $text = $this->span($text);
745 $text = $this->glyphs($text);
749 …f="' . $this->encode_html($url . $slash) . '"' . $atts . $this->rel . '>' . $text . '</a>' . $post;
757 function getRefs($text) argument
760 array(&$this, "refs"), $text);
772 function checkRefs($text) argument
774 return (isset($this->urlrefs[$text])) ? $this->urlrefs[$text] : $text;
792 function image($text) argument
806 /Ux", array(&$this, "fImage"), $text);
835 function code($text) argument
837 $text = $this->doSpecial($text, '<code>', '</code>', 'fCode');
838 $text = $this->doSpecial($text, '@', '@', 'fCode');
839 $text = $this->doSpecial($text, '<pre>', '</pre>', 'fPre');
840 return $text;
846 @list(, $before, $text, $after) = $m;
849 return $before.$this->shelve('<code>'.$text.'</code>').$after;
851 return $before.$this->shelve('<code>'.$this->encode_html($text).'</code>').$after;
857 @list(, $before, $text, $after) = $m;
860 return $before.'<pre>'.$this->shelve($text).'</pre>'.$after;
862 return $before.'<pre>'.$this->shelve($this->encode_html($text)).'</pre>'.$after;
873 function retrieve($text) argument
877 $old = $text;
878 $text = strtr($text, $this->shelf);
879 } while ($text != $old);
881 return $text;
886 function incomingEntities($text) argument
888 return preg_replace("/&(?![#a-z0-9]+;)/i", "x%x%", $text);
893 function encodeEntities($text) argument
896 ? $this->encode_high($text)
897 : htmlentities($text, ENT_NOQUOTES, "utf-8");
902 function fixEntities($text) argument
906 array(">", "<", "&"), $text);
910 function cleanWhiteSpace($text) argument
912 $out = str_replace("\r\n", "\n", $text);
920 function doSpecial($text, $start, $end, $method='fSpecial') argument
923 array(&$this, $method), $text);
930 @list(, $before, $text, $after) = $m;
931 return $before.$this->shelve($this->encode_html($text)).$after;
935 function noTextile($text) argument
937 $text = $this->doSpecial($text, '<notextile>', '</notextile>', 'fTextile');
938 return $this->doSpecial($text, '==', '==', 'fTextile');
951 function footnoteRef($text) argument
954 '$this->footnoteID(\'\1\',\'\2\')', $text);
967 function glyphs($text) argument
970 $text = preg_replace('/"\z/', "\" ", $text);
1011 $text = preg_split("/(<.*>)/U", $text, -1, PREG_SPLIT_DELIM_CAPTURE);
1012 foreach($text as $line) {
1013 if (!preg_match("/<.*>/", $line)) {
1014 $line = preg_replace($glyph_search, $glyph_replace, $line);
1016 $glyph_out[] = $line;
1054 function encode_high($text, $charset = "UTF-8") argument
1056 return mb_encode_numericentity($text, $this->cmap(), $charset);
1061 function decode_high($text, $charset = "UTF-8") argument
1063 return mb_decode_numericentity($text, $this->cmap(), $charset);
1127 function blockLite($text) argument
1130 return $this->block($text."\n\n");