Uname: Linux yisu-647059427c03a 3.10.0-862.14.4.el7.x86_64 #1 SMP Wed Sep 26 15:12:11 UTC 2018 x86_64
Software: nginx/1.22.1
PHP version: 7.3.31 [ PHP INFO ] PHP os: Linux
Server Ip: 103.146.158.90
Your Ip: 216.73.216.141
User: www (1000) | Group: www (1000)
Safe Mode: OFF
Disable Function:
passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv

name : Context.php
<?php

/*
 * This file is part of the league/commonmark package.
 *
 * (c) Colin O'Dell <colinodell@gmail.com>
 *
 * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js)
 *  - (c) John MacFarlane
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace League\CommonMark;

use League\CommonMark\Block\Element\AbstractBlock;
use League\CommonMark\Block\Element\Document;
use League\CommonMark\Reference\ReferenceParser;

/**
 * Maintains the current state of the Markdown parser engine
 */
class Context implements ContextInterface
{
    /**
     * @var EnvironmentInterface
     */
    protected $environment;

    /**
     * @var Document
     */
    protected $doc;

    /**
     * @var AbstractBlock|null
     */
    protected $tip;

    /**
     * @var AbstractBlock
     */
    protected $container;

    /**
     * @var int
     */
    protected $lineNumber;

    /**
     * @var string
     */
    protected $line;

    /**
     * @var UnmatchedBlockCloser
     */
    protected $blockCloser;

    /**
     * @var bool
     */
    protected $blocksParsed = false;

    /**
     * @var ReferenceParser
     */
    protected $referenceParser;

    public function __construct(Document $document, EnvironmentInterface $environment)
    {
        $this->doc = $document;
        $this->tip = $this->doc;
        $this->container = $this->doc;

        $this->environment = $environment;

        $this->referenceParser = new ReferenceParser($document->getReferenceMap());

        $this->blockCloser = new UnmatchedBlockCloser($this);
    }

    /**
     * @param string $line
     *
     * @return void
     */
    public function setNextLine(string $line)
    {
        ++$this->lineNumber;
        $this->line = $line;
    }

    public function getDocument(): Document
    {
        return $this->doc;
    }

    public function getTip(): ?AbstractBlock
    {
        return $this->tip;
    }

    /**
     * @param AbstractBlock|null $block
     *
     * @return $this
     */
    public function setTip(?AbstractBlock $block)
    {
        $this->tip = $block;

        return $this;
    }

    public function getLineNumber(): int
    {
        return $this->lineNumber;
    }

    public function getLine(): string
    {
        return $this->line;
    }

    public function getBlockCloser(): UnmatchedBlockCloser
    {
        return $this->blockCloser;
    }

    public function getContainer(): AbstractBlock
    {
        return $this->container;
    }

    /**
     * @param AbstractBlock $container
     *
     * @return $this
     */
    public function setContainer(AbstractBlock $container)
    {
        $this->container = $container;

        return $this;
    }

    public function addBlock(AbstractBlock $block)
    {
        $this->blockCloser->closeUnmatchedBlocks();
        $block->setStartLine($this->lineNumber);

        while ($this->tip !== null && !$this->tip->canContain($block)) {
            $this->tip->finalize($this, $this->lineNumber);
        }

        // This should always be true
        if ($this->tip !== null) {
            $this->tip->appendChild($block);
        }

        $this->tip = $block;
        $this->container = $block;
    }

    public function replaceContainerBlock(AbstractBlock $replacement)
    {
        $this->blockCloser->closeUnmatchedBlocks();
        $replacement->setStartLine($this->container->getStartLine());
        $this->container->replaceWith($replacement);

        if ($this->tip === $this->container) {
            $this->tip = $replacement;
        }

        $this->container = $replacement;
    }

    public function getBlocksParsed(): bool
    {
        return $this->blocksParsed;
    }

    /**
     * @param bool $bool
     *
     * @return $this
     */
    public function setBlocksParsed(bool $bool)
    {
        $this->blocksParsed = $bool;

        return $this;
    }

    public function getReferenceParser(): ReferenceParser
    {
        return $this->referenceParser;
    }
}
© 2026 GrazzMean
https://ai.shandianfk.com/wp-sitemap-posts-post-1.xmlhttps://ai.shandianfk.com/wp-sitemap-posts-page-1.xmlhttps://ai.shandianfk.com/wp-sitemap-taxonomies-category-1.xmlhttps://ai.shandianfk.com/wp-sitemap-taxonomies-post_tag-1.xmlhttps://ai.shandianfk.com/wp-sitemap-users-1.xml