本文整理汇总了PHP中League\CommonMark\Cursor::isBlank方法的典型用法代码示例。如果您正苦于以下问题:PHP Cursor::isBlank方法的具体用法?PHP Cursor::isBlank怎么用?PHP Cursor::isBlank使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类League\CommonMark\Cursor
的用法示例。
在下文中一共展示了Cursor::isBlank方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: matchesNextLine
public function matchesNextLine(Cursor $cursor)
{
if ($cursor->isBlank() && ($this->type === self::TYPE_6_BLOCK_ELEMENT || $this->type === self::TYPE_7_MISC_ELEMENT)) {
return false;
}
return true;
}
示例2: matchesNextLine
public function matchesNextLine(Cursor $cursor)
{
if ($cursor->isBlank()) {
$this->lastLineBlank = true;
return false;
}
return true;
}
示例3: handleRemainingContents
/**
* @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());
}
示例4: matchesNextLine
public function matchesNextLine(Cursor $cursor)
{
if ($cursor->isBlank()) {
$this->setLastLineBlank(true);
} else {
$this->setLastLineBlank(false);
}
return false;
}
示例5: matchesNextLine
public function matchesNextLine(Cursor $cursor)
{
if ($cursor->getIndent() >= IndentedCodeParser::CODE_INDENT_LEVEL) {
$cursor->advanceBy(IndentedCodeParser::CODE_INDENT_LEVEL);
} elseif ($cursor->isBlank()) {
$cursor->advanceToFirstNonSpace();
} else {
return false;
}
return true;
}
示例6: matchesNextLine
public function matchesNextLine(Cursor $cursor)
{
if ($cursor->isIndented()) {
$cursor->advanceBy(Cursor::INDENT_LEVEL, true);
} elseif ($cursor->isBlank()) {
$cursor->advanceToFirstNonSpace();
} else {
return false;
}
return true;
}
示例7: parse
/**
* @param ContextInterface $context
* @param Cursor $cursor
*
* @return bool
*/
public function parse(ContextInterface $context, Cursor $cursor)
{
if (!$cursor->isIndented()) {
return false;
}
if ($context->getTip() instanceof Paragraph) {
return false;
}
if ($cursor->isBlank()) {
return false;
}
$cursor->advanceBy(Cursor::INDENT_LEVEL, true);
$context->addBlock(new IndentedCode());
return true;
}
示例8: shouldLastLineBeBlank
/**
* @param Cursor $cursor
* @param int $currentLineNumber
*
* @return bool
*/
public function shouldLastLineBeBlank(Cursor $cursor, $currentLineNumber)
{
return $cursor->isBlank() && $this->startLine < $currentLineNumber;
}
示例9: shouldLastLineBeBlank
/**
* Determines whether the last line should be marked as blank
*
* @param Cursor $cursor
* @param int $currentLineNumber
*
* @return bool
*/
public function shouldLastLineBeBlank(Cursor $cursor, $currentLineNumber)
{
return $cursor->isBlank();
}
示例10: matchesNextLine
public function matchesNextLine(Cursor $cursor)
{
if ($this->length === -1) {
if ($cursor->isBlank()) {
$this->lastLineBlank = true;
}
return false;
}
// Skip optional spaces of fence offset
$cursor->advanceWhileMatches(' ', $this->offset);
return true;
}
示例11: isLazyParagraphContinuation
/**
* @param ContextInterface $context
* @param Cursor $cursor
*
* @return bool
*/
private function isLazyParagraphContinuation(ContextInterface $context, Cursor $cursor)
{
return !$context->getBlockCloser()->areAllClosed() && !$cursor->isBlank() && $context->getTip() instanceof Paragraph && count($context->getTip()->getStrings()) > 0;
}
示例12: setLastLineBlank
/**
* @param Cursor $cursor
* @param int $currentLineNumber
*
* @return $this
*/
public function setLastLineBlank(Cursor $cursor, $currentLineNumber)
{
$this->lastLineBlank = $cursor->isBlank();
$container = $this;
while ($container->getParent()) {
$container = $container->getParent();
$container->lastLineBlank = false;
}
return $this;
}
示例13: setAndPropagateLastLineBlank
/**
* @param ContextInterface $context
* @param Cursor $cursor
*/
private function setAndPropagateLastLineBlank(ContextInterface $context, $cursor)
{
if ($cursor->isBlank() && ($lastChild = $context->getContainer()->lastChild())) {
if ($lastChild instanceof AbstractBlock) {
$lastChild->setLastLineBlank(true);
}
}
$container = $context->getContainer();
$lastLineBlank = $container->shouldLastLineBeBlank($cursor, $context->getLineNumber());
// Propagate lastLineBlank up through parents:
while ($container) {
$container->setLastLineBlank($lastLineBlank);
$container = $container->parent();
}
}
示例14: matchesNextLine
public function matchesNextLine(Cursor $cursor)
{
return !$cursor->isBlank();
}