League\CommonMark\Cursor::getRemainder PHP Method

getRemainder() public method

public getRemainder ( ) : string
return string
    public function getRemainder()
    {
        if ($this->isAtEnd()) {
            return '';
        }
        $prefix = '';
        $position = $this->currentPosition;
        if ($this->partiallyConsumedTab) {
            $position++;
            $charsToTab = 4 - $this->column % 4;
            $prefix = str_repeat(' ', $charsToTab);
        }
        return $prefix . mb_substr($this->line, $position, null, 'utf-8');
    }

Usage Example

Beispiel #1
0
 /**
  * @param ContextInterface $context
  * @param Cursor           $cursor
  */
 public function handleRemainingContents(ContextInterface $context, Cursor $cursor)
 {
     if ($cursor->isBlank()) {
         return;
     }
     $context->addBlock(new Paragraph());
     $cursor->advanceToFirstNonSpace();
     $context->getTip()->addLine($cursor->getRemainder());
 }
All Usage Examples Of League\CommonMark\Cursor::getRemainder