Lines Matching defs:Block

194                 $Block = $this->{'block'.$CurrentBlock['type'].'Continue'}($Line, $CurrentBlock);
196 if (isset($Block))
198 $CurrentBlock = $Block;
232 $Block = $this->{'block'.$blockType}($Line, $CurrentBlock);
234 if (isset($Block))
236 $Block['type'] = $blockType;
238 if ( ! isset($Block['identified']))
242 $Block['identified'] = true;
247 $Block['continuable'] = true;
250 $CurrentBlock = $Block;
289 foreach ($Blocks as $Block)
291 if (isset($Block['hidden']))
297 $markup .= isset($Block['markup']) ? $Block['markup'] : $this->element($Block['element']);
320 protected function blockCode($Line, $Block = null)
322 if (isset($Block) and ! isset($Block['type']) and ! isset($Block['interrupted']))
331 $Block = array(
342 return $Block;
346 protected function blockCodeContinue($Line, $Block)
350 if (isset($Block['interrupted']))
352 $Block['element']['text']['text'] .= "\n";
354 unset($Block['interrupted']);
357 $Block['element']['text']['text'] .= "\n";
361 $Block['element']['text']['text'] .= $text;
363 return $Block;
367 protected function blockCodeComplete($Block)
369 $text = $Block['element']['text']['text'];
371 $Block['element']['text']['text'] = $text;
373 return $Block;
388 $Block = array(
394 $Block['closed'] = true;
397 return $Block;
401 protected function blockCommentContinue($Line, array $Block)
403 if (isset($Block['closed']))
408 $Block['markup'] .= "\n" . $Line['body'];
412 $Block['closed'] = true;
415 return $Block;
453 $Block = array(
462 return $Block;
466 protected function blockFencedCodeContinue($Line, $Block)
468 if (isset($Block['complete']))
473 if (isset($Block['interrupted']))
475 $Block['element']['text']['text'] .= "\n";
477 unset($Block['interrupted']);
480 if (preg_match('/^'.$Block['char'].'{3,}[ ]*$/', $Line['text']))
482 $Block['element']['text']['text'] = substr($Block['element']['text']['text'], 1);
484 $Block['complete'] = true;
486 return $Block;
489 $Block['element']['text']['text'] .= "\n".$Line['body'];
491 return $Block;
494 protected function blockFencedCodeComplete($Block)
496 $text = $Block['element']['text']['text'];
498 $Block['element']['text']['text'] = $text;
500 return $Block;
524 $Block = array(
532 return $Block;
545 $Block = array(
560 $Block['element']['attributes'] = array('start' => $listStart);
564 $Block['li'] = array(
572 $Block['element']['text'] []= & $Block['li'];
574 return $Block;
578 protected function blockListContinue($Line, array $Block)
580 if ($Block['indent'] === $Line['indent'] and preg_match('/^'.$Block['pattern'].'(?:[ ]+(.*)|$)/', $Line['text'], $matches))
582 if (isset($Block['interrupted']))
584 $Block['li']['text'] []= '';
586 $Block['loose'] = true;
588 unset($Block['interrupted']);
591 unset($Block['li']);
595 $Block['li'] = array(
603 $Block['element']['text'] []= & $Block['li'];
605 return $Block;
610 return $Block;
613 if ( ! isset($Block['interrupted']))
617 $Block['li']['text'] []= $text;
619 return $Block;
624 $Block['li']['text'] []= '';
628 $Block['li']['text'] []= $text;
630 unset($Block['interrupted']);
632 return $Block;
636 protected function blockListComplete(array $Block)
638 if (isset($Block['loose']))
640 foreach ($Block['element']['text'] as &$li)
649 return $Block;
659 $Block = array(
667 return $Block;
671 protected function blockQuoteContinue($Line, array $Block)
675 if (isset($Block['interrupted']))
677 $Block['element']['text'] []= '';
679 unset($Block['interrupted']);
682 $Block['element']['text'] []= $matches[1];
684 return $Block;
687 if ( ! isset($Block['interrupted']))
689 $Block['element']['text'] []= $Line['text'];
691 return $Block;
702 $Block = array(
708 return $Block;
715 protected function blockSetextHeader($Line, array $Block = null)
717 if ( ! isset($Block) or isset($Block['type']) or isset($Block['interrupted']))
724 $Block['element']['name'] = $Line['text'][0] === '=' ? 'h1' : 'h2';
726 return $Block;
749 $Block = array(
763 $Block['closed'] = true;
765 $Block['void'] = true;
777 $Block['closed'] = true;
781 return $Block;
785 protected function blockMarkupContinue($Line, array $Block)
787 if (isset($Block['closed']))
792 if (preg_match('/^<'.$Block['name'].'(?:[ ]*'.$this->regexHtmlAttribute.')*[ ]*>/i', $Line['text'])) # open
794 $Block['depth'] ++;
797 if (preg_match('/(.*?)<\/'.$Block['name'].'>[ ]*$/i', $Line['text'], $matches)) # close
799 if ($Block['depth'] > 0)
801 $Block['depth'] --;
805 $Block['closed'] = true;
809 if (isset($Block['interrupted']))
811 $Block['markup'] .= "\n";
813 unset($Block['interrupted']);
816 $Block['markup'] .= "\n".$Line['body'];
818 return $Block;
842 $Block = array(
846 return $Block;
853 protected function blockTable($Line, array $Block = null)
855 if ( ! isset($Block) or isset($Block['type']) or isset($Block['interrupted']))
860 if (strpos($Block['element']['text'], '|') !== false and chop($Line['text'], ' -:|') === '')
899 $header = $Block['element']['text'];
930 $Block = array(
939 $Block['element']['text'] []= array(
944 $Block['element']['text'] []= array(
950 $Block['element']['text'][0]['text'] []= array(
956 return $Block;
960 protected function blockTableContinue($Line, array $Block)
962 if (isset($Block['interrupted']))
988 if (isset($Block['alignments'][$index]))
991 'style' => 'text-align: '.$Block['alignments'][$index].';',
1004 $Block['element']['text'][1]['text'] []= $Element;
1006 return $Block;
1016 $Block = array(
1024 return $Block;