28 lines
901 B
PHP
28 lines
901 B
PHP
|
<?php
|
||
|
|
||
|
namespace WMarkDown\Modules;
|
||
|
|
||
|
class Quotes extends \WMarkDown\Abstracts\Modules{
|
||
|
|
||
|
public function get_next_position($string){
|
||
|
|
||
|
if(
|
||
|
$this->more &&
|
||
|
$this->from < 0 &&
|
||
|
$this->more = preg_match('/^((^>+ ?)(([^\r\n]+)(\r\n|[\r\n])?)+)/m', $string, $this->matches, PREG_OFFSET_CAPTURE)
|
||
|
)
|
||
|
$this->from = $this->matches[0][1];
|
||
|
|
||
|
}
|
||
|
|
||
|
public function process($string, $modules, $level){
|
||
|
|
||
|
$this->length = strlen($this->matches[0][0]);
|
||
|
$this->to = $this->from + $this->length;
|
||
|
$this->content = $this->matches[1][0];
|
||
|
$this->html = '<blockquote class="quote">' . \WMarkDown\Modules::format($this->wmarkdown, substr($this->matches[1][0], 1), ["paragraphs"], $modules)["content"] . '</blockquote>';
|
||
|
|
||
|
}
|
||
|
|
||
|
};
|