format() public static méthode

public static format ( $in )
Exemple #1
0
 public function format()
 {
     return Markup::format($this->object->data);
 }
Exemple #2
0
function edit_preview($content)
{
    $view = new View('page-edit-preview.php');
    $view->contents = Markup::format($content);
    return $view->display(TRUE);
}
Exemple #3
0
 public function format()
 {
     return str_replace("\n", "<br />\n", $this->object->data);
     return Markup::format($this->object->data);
 }
Exemple #4
0
<?php

require_once __DIR__ . '/markuplite.class.php';
require_once __DIR__ . '/../../src/luminous.php';
class Markup
{
    public $linker = null;
    private $obj = null;
    function linker($url)
    {
        return false;
    }
    public function __construct()
    {
        $this->linker = array($this, 'linker');
    }
    function format($str)
    {
        $m = new MarkupLite();
        $m->linkifier_cb = $this->linker;
        $m->highlight_cb = create_function('$code,$lang', 'return luminous::highlight($lang, $code);');
        return $m->Format($str);
    }
}
$m = new Markup();
$in = '';
while (($line = fgets(STDIN)) !== false) {
    $in .= $line;
}
echo $m->format($in);