Lines Matching +refs:text +refs:line

45 	 * @param string $text the text to parse
48 public function parse($text) argument
52 if (ltrim($text) === '') {
56 $text = str_replace(["\r\n", "\n\r", "\r"], "\n", $text);
58 $this->prepareMarkers($text);
60 $absy = $this->parseBlocks(explode("\n", $text));
70 * @param string $text the text to parse
73 public function parseParagraph($text) argument
77 if (ltrim($text) === '') {
81 $text = str_replace(["\r\n", "\n\r", "\r"], "\n", $text);
83 $this->prepareMarkers($text);
85 $absy = $this->parseInline($text);
140 $line = $lines[$current];
143 if ($this->{'identify' . $blockType}($line, $lines, $current)) {
167 $line = $lines[$i];
168 if ($line !== '' && rtrim($line) !== '') { // skip empty lines
292 * @param string $text
294 protected function prepareMarkers($text) argument
298 if (strpos($text, $marker) !== false) {
316 * @param string $text the inline text to parse.
319 protected function parseInline($text) argument
323 return [['text', $text]];
331 while (!empty($markers) && ($found = strpbrk($text, $markers)) !== false) {
333 $pos = strpos($text, $found);
337 $paragraph[] = ['text', substr($text, 0, $pos)];
339 $text = $found;
342 foreach ($this->_inlineMarkers[$text[0]] as $marker => $method) {
343 if (strncmp($text, $marker, strlen($marker)) === 0) {
346 list($output, $offset) = $this->$method($text);
350 $text = substr($text, $offset);
356 $paragraph[] = ['text', substr($text, 0, 1)];
357 $text = substr($text, 1);
361 $paragraph[] = ['text', $text];
372 protected function parseEscape($text) argument
374 if (isset($text[1]) && in_array($text[1], $this->escapeCharacters)) {
375 return [['text', $text[1]], 2];
377 return [['text', $text[0]], 1];