Texy\BlockParser::isIndented PHP Method

isIndented() public method

public isIndented ( )
    public function isIndented()
    {
        return $this->indented;
    }

Usage Example

コード例 #1
0
ファイル: ParagraphModule.php プロジェクト: chomenko/cemvin
 /**
  * @return void
  */
 public function process(Texy\BlockParser $parser, $content, Texy\HtmlElement $el)
 {
     if ($parser->isIndented()) {
         $parts = preg_split('#(\\n(?! )|\\n{2,})#', $content, -1, PREG_SPLIT_NO_EMPTY);
     } else {
         $parts = preg_split('#(\\n{2,})#', $content, -1, PREG_SPLIT_NO_EMPTY);
     }
     foreach ($parts as $s) {
         $s = trim($s);
         if ($s === '') {
             continue;
         }
         // try to find modifier
         $mod = NULL;
         if ($mx = Regexp::match($s, '#' . Texy\Patterns::MODIFIER_H . '(?=\\n|\\z)#sUm', Regexp::OFFSET_CAPTURE)) {
             list($mMod) = $mx[1];
             $s = trim(substr_replace($s, '', $mx[0][1], strlen($mx[0][0])));
             if ($s === '') {
                 continue;
             }
             $mod = new Texy\Modifier();
             $mod->setProperties($mMod);
         }
         $res = $this->texy->invokeAroundHandlers('paragraph', $parser, [$s, $mod]);
         if ($res) {
             $el->insert(NULL, $res);
         }
     }
 }
All Usage Examples Of Texy\BlockParser::isIndented