当前位置: 首页>>代码示例>>PHP>>正文


PHP Cursor::isBlank方法代码示例

本文整理汇总了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;
 }
开发者ID:colinodell,项目名称:commonmark-php,代码行数:7,代码来源:HtmlBlock.php

示例2: matchesNextLine

 public function matchesNextLine(Cursor $cursor)
 {
     if ($cursor->isBlank()) {
         $this->lastLineBlank = true;
         return false;
     }
     return true;
 }
开发者ID:LyricFinancial,项目名称:integration-guides,代码行数:8,代码来源:Paragraph.php

示例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());
 }
开发者ID:austinvernsonger,项目名称:markua,代码行数:13,代码来源:Aside.php

示例4: matchesNextLine

 public function matchesNextLine(Cursor $cursor)
 {
     if ($cursor->isBlank()) {
         $this->setLastLineBlank(true);
     } else {
         $this->setLastLineBlank(false);
     }
     return false;
 }
开发者ID:webuni,项目名称:commonmark-attributes-extension,代码行数:9,代码来源:Attributes.php

示例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;
 }
开发者ID:alvarobfdev,项目名称:LaravelCore,代码行数:11,代码来源:IndentedCode.php

示例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;
 }
开发者ID:ssomenzi,项目名称:silence,代码行数:11,代码来源:IndentedCode.php

示例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;
 }
开发者ID:LyricFinancial,项目名称:integration-guides,代码行数:21,代码来源:IndentedCodeParser.php

示例8: shouldLastLineBeBlank

 /**
  * @param Cursor $cursor
  * @param int    $currentLineNumber
  *
  * @return bool
  */
 public function shouldLastLineBeBlank(Cursor $cursor, $currentLineNumber)
 {
     return $cursor->isBlank() && $this->startLine < $currentLineNumber;
 }
开发者ID:colinodell,项目名称:commonmark-php,代码行数:10,代码来源:ListItem.php

示例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();
 }
开发者ID:0b10011,项目名称:commonmark,代码行数:12,代码来源:AbstractBlock.php

示例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;
 }
开发者ID:alvarobfdev,项目名称:applog,代码行数:12,代码来源:FencedCode.php

示例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;
 }
开发者ID:ssomenzi,项目名称:silence,代码行数:10,代码来源:DocParser.php

示例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;
 }
开发者ID:alvarobfdev,项目名称:LaravelCore,代码行数:16,代码来源:AbstractBlock.php

示例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();
     }
 }
开发者ID:colinodell,项目名称:commonmark-php,代码行数:19,代码来源:DocParser.php

示例14: matchesNextLine

 public function matchesNextLine(Cursor $cursor)
 {
     return !$cursor->isBlank();
 }
开发者ID:alvarobfdev,项目名称:applog,代码行数:4,代码来源:HtmlBlock.php


注:本文中的League\CommonMark\Cursor::isBlank方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。