uawdijnntqw1x1x1
IP : 216.73.216.127
Hostname : toronto-dev2
Kernel : Linux toronto-dev2 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64
Disable Function : None :)
OS : Linux
PATH:
/
srv
/
users
/
craft4
/
apps
/
craft4-newsite-space
/
.
/
vendor
/
.
/
bin
/
..
/
cebe
/
markdown
/
block
/
HeadlineTrait.php
/
/
<?php /** * @copyright Copyright (c) 2014 Carsten Brandt * @license https://github.com/cebe/markdown/blob/master/LICENSE * @link https://github.com/cebe/markdown#readme */ namespace cebe\markdown\block; /** * Adds the headline blocks */ trait HeadlineTrait { /** * identify a line as a headline */ protected function identifyHeadline($line, $lines, $current) { return ( // heading with # $line[0] === '#' && !preg_match('/^#\d+/', $line) || // underlined headline !empty($lines[$current + 1]) && (($l = $lines[$current + 1][0]) === '=' || $l === '-') && preg_match('/^(\-+|=+)\s*$/', $lines[$current + 1]) ); } /** * Consume lines for a headline */ protected function consumeHeadline($lines, $current) { if ($lines[$current][0] === '#') { // ATX headline $level = 1; while (isset($lines[$current][$level]) && $lines[$current][$level] === '#' && $level < 6) { $level++; } $block = [ 'headline', 'content' => $this->parseInline(trim($lines[$current], "# \t")), 'level' => $level, ]; return [$block, $current]; } else { // underlined headline $block = [ 'headline', 'content' => $this->parseInline($lines[$current]), 'level' => $lines[$current + 1][0] === '=' ? 1 : 2, ]; return [$block, $current + 1]; } } /** * Renders a headline */ protected function renderHeadline($block) { $tag = 'h' . $block['level']; return "<$tag>" . $this->renderAbsy($block['content']) . "</$tag>\n"; } abstract protected function parseInline($text); abstract protected function renderAbsy($absy); }
/srv/users/craft4/apps/craft4-newsite-space/./vendor/./bin/../cebe/markdown/block/HeadlineTrait.php