League\CommonMark\Cursor::getIndent PHP Method

getIndent() public method

Calculates the current indent (number of spaces after current position)
public getIndent ( ) : integer
return integer
    public function getIndent()
    {
        $this->getFirstNonSpacePosition();
        return $this->indent;
    }

Usage Example

 /**
  * @param ContextInterface $context
  * @param Cursor $cursor
  *
  * @return bool
  */
 public function parse(ContextInterface $context, Cursor $cursor)
 {
     if ($cursor->getIndent() < IndentedCodeParser::CODE_INDENT_LEVEL) {
         return false;
     }
     $context->setBlocksParsed(true);
     return true;
 }
All Usage Examples Of League\CommonMark\Cursor::getIndent