Parse the given content.

Any newly created nodes should be appended to the given target. Any remaining content should be passed to the
next parser in the chain.

@param Text $content
@param InlineNodeAcceptorInterface $target
@return void
482776
public function parseInline(Text $content, InlineNodeAcceptorInterface $target)
    {
        $content->handle(
            '/(\\\\\n)|( {2,}\n)/',
            function () use ($target) {
                $target->addInline(new HardBreak());
            },
            function (Text $part) use ($target) {
                $this->next->parseInline($part, $target);
            }
        );
    }
1085425
public function invoke($node, NodeInterface $parent): void
    {
        if (! $node instanceof Node\Stmt\Use_ || ! $parent instanceof PhpFileModelInterface) {
            throw new Exception('UseNodeParser is made to parse a use node');
        }

        if ($node->type === Node\Stmt\Use_::TYPE_NORMAL) {
            foreach ($node->uses as $use) {
                $parent->addUse($use->getAlias()->name, $use->name->toString());
            }
        }
    }
480336
public function write(SpecificationRepresentationInterface $specificationRepresentation, $target)
    {
        $this->guardAgainstEmptyTarget($target);

        $renderedSpecification = $specificationRepresentation->render();

        $this->guardAgainstEmptyRenderedSpecification($target, $renderedSpecification);

        $this->createDirectoryIfNotExist($target);

        $result = file_put_contents(
            $target,
            $specificationRepresentation->render()
        );

        $this->guardAgainstNotWrittenSpecification($target, $result);
    }
1363038
public function handle(Parser $parser, \DOMNode $node, NodeInterface $target)
    {
        $parser->parseNodeChildren($node, $target);
    }
575658
def parse(self, target):
        
        if not isinstance(target, Node):
            parent = ContentNode(None, None, [])
            parent.parse(target)
            target = parent

        super(Declaration, self).parse(target)
        self.name = str(self.data[0])
        while isinstance(target, Declaration):
            self.name = '-'.join((str(target.data[0]), self.name))
            target = target.parent

        self.expr = ' '.join(str
                             (n)
                             for n in self.data
                             [2:] if not isinstance(n, Declaration))
        if self.expr:
            target.declareset.append(self)
413013
public function modify(string $content, string $plainText = null)
    {
        $this->html = $content;
        $this->text = $plainText;
    }
922042
protected function processTagContent(?string $tagContent = null): void
    {
        $varPoss = $this->loadAndCheckVarPositions();

        if ($varPoss) {
            $this->checkArgumentItself($tagContent);
            $this->checkAgainstPattern($tagContent);
            $this->checkType();
            $this->checkDescription();
        }
    }
931981
public static function update($target, $content, $message = '', $append = false, $style = null) {
		$args = ['content' => $content, 'append' => $append];

		return new JsonView([
			'code'    => self::SUCCESS,
			'target'  => $target,
			'message' => $message,
			'style'   => $style,
			'args'    => $args,
			'action'  => self::ACT_UPDATE
		], ['ajax' => '1']);
	}
341815
public function handle(Parser $parser, \DOMNode $node, NodeInterface $target)
    {
        $url = $node->attributes->getNamedItem('href')->nodeValue;
        $type = $node->attributes->getNamedItem('type')->nodeValue;
        $length = intval($node->attributes->getNamedItem('length')->nodeValue, 10);
        $title = $node->attributes->getNamedItem('title') ? $node->attributes->getNamedItem('title')->nodeValue : basename($url);
        $enclosure = new Enclosure();
        $enclosure
            ->setType($type)
            ->setLength($length)
            ->setTitle($title)
            ->setUrl($url);
        /** @var ItemInterface $target */
        $target->addEnclosure($enclosure);
    }
893076
protected function processBlocks(string &$content): void
    {
        $pattern = $this->getTagPattern('block\s+([_a-zA-Z][_a-zA-Z0-9]*)' . preg_quote($this->endTag, '/') . '\s*(.+?)\s*' . preg_quote($this->startTag . '/block', '/'));
        $blockCodes = [];
        $content = preg_replace_callback($pattern, function ($match) use (&$blockCodes) {
            $blockCodes[$match[1]] = $match[2];
            return '';
        }, $content);
        $displayPattern = $this->getTagPattern('display_block\s+([_a-zA-Z][_a-zA-Z0-9]*)');
        $content = preg_replace_callback($displayPattern, function ($match) use ($blockCodes) {
            if (isset($blockCodes[$match[1]])) {
                return $blockCodes[$match[1]];
            }
            return '';
        }, $content);
    }
617613
public function parseBlock(Text $content, Container $target)
    {
        $content->handle(
            '/
                (
                    (?:                             # We are either at the beginning of the match
                        ^|\n                        # or at a newline (for multi-line quotes)
                    )
                    (?:
                        [ ]{0,3}\>[ ]*              # either a blank line
                      |
                        [ ]{0,3}\>[ ]?[`~]{3,}.*    # or a code fence
                      |
                        [ ]{0,3}\>                  # or non-blank lines...
                        [ ]*[^\n\ ][^\n]*[ ]*
                        (                           # ...with lazy continuation
                            \n
                            [ ]{0,3}
                            [^>\-+*=\ \n][^\n]*
                        )*
                    )
                )+
                $
            /mx',
            function (Text $content) use ($target) {
                // Remove block quote marker plus surrounding whitespace on each line
                $content->replace('/^[ ]{0,3}\>[ ]?/m', '');

                $blockquote = new Blockquote();
                $target->addChild($blockquote);

                $this->first->parseBlock($content, $blockquote);
            },
            function (Text $part) use ($target) {
                $this->next->parseBlock($part, $target);
            }
        );
    }
136925
public function setContent($text, $type = 'text')
    {
        $this->setType($type);
        $this->getDomElement()->nodeValue = $text;
        $this->setCachedProperty('content', $this->parseContent());
    }
1161832
public function setRibbonXMLData($Target=NULL, $XMLData=NULL){
		if(!is_null($Target) && !is_null($XMLData)){
			$this->_ribbonXMLData=array('target'=>$Target, 'data'=>$XMLData);
		}else{
			$this->_ribbonXMLData=NULL;
		}
	}
1301655
private function _retrieveNodeText(DOMNode $node, &$text)
    {
        if ($node->nodeType == XML_TEXT_NODE) {
            $text .= $node->nodeValue;
            if(!in_array($node->parentNode->tagName, $this->_inlineTags)) {
                $text .= ' ';
            }
        } else if ($node->nodeType == XML_ELEMENT_NODE  &&  $node->nodeName != 'script') {
            foreach ($node->childNodes as $childNode) {
                $this->_retrieveNodeText($childNode, $text);
            }
        }
    }
1145973
function parse($text) {
		$text=parent::parse($text);
		// Build tree structure
		for ($ptr=0,$w=5,$len=strlen($text),$tree=[],$tmp='';$ptr<$len;)
			if (preg_match('/^(.{0,'.$w.'}?)<(\/?)(?:F3:)?'.
				'('.$this->tags.')\b((?:\s+[\w.:@!-]+'.
				'(?:\h*=\h*(?:"(?:.*?)"|\'(?:.*?)\'))?|'.
				'\h*\{\{.+?\}\})*)\h*(\/?)>/is',
				substr($text,$ptr),$match)) {
				if (strlen($tmp) || $match[1])
					$tree[]=$tmp.$match[1];
				// Element node
				if ($match[2]) {
					// Find matching start tag
					$stack=[];
					for($i=count($tree)-1;$i>=0;$i--) {
						$item=$tree[$i];
						if (is_array($item) &&
							array_key_exists($match[3],$item) &&
							!isset($item[$match[3]][0])) {
							// Start tag found
							$tree[$i][$match[3]]+=array_reverse($stack);
							$tree=array_slice($tree,0,$i+1);
							break;
						}
						else $stack[]=$item;
					}
				}
				else {
					// Start tag
					$node=&$tree[][$match[3]];
					$node=[];
					if ($match[4]) {
						// Process attributes
						preg_match_all(
							'/(?:(\{\{.+?\}\})|([^\s\/"\'=]+))'.
							'\h*(?:=\h*(?:"(.*?)"|\'(.*?)\'))?/s',
							$match[4],$attr,PREG_SET_ORDER);
						foreach ($attr as $kv)
							if (!empty($kv[1]) && !isset($kv[3]) && !isset($kv[4]))
								$node['@attrib'][]=$kv[1];
							else
								$node['@attrib'][$kv[1]?:$kv[2]]=
									(isset($kv[3]) && $kv[3]!==''?
										$kv[3]:
										(isset($kv[4]) && $kv[4]!==''?
											$kv[4]:NULL));
					}
				}
				$tmp='';
				$ptr+=strlen($match[0]);
				$w=5;
			}
			else {
				// Text node
				$tmp.=substr($text,$ptr,$w);
				$ptr+=$w;
				if ($w<50)
					$w++;
			}
		if (strlen($tmp))
			// Append trailing text
			$tree[]=$tmp;
		// Break references
		unset($node);
		return $tree;
	}
623785
public function output($target, $content)
    {
        foreach ($this->filters as $filter) {
            $content = $filter->output($target, $content);
        }
        return $content;
    }
676184
public function parseBlock(Text $content, Container $target)
    {
        $content->handle(
            '{
                ^(?:
                    ([ ]{0,3})                  #1 Initial indentation
                    (                           #2 Fence
                        ([`~])                  #3 The fence character (` or ~)
                        \3{2,}                  #  At least two remaining fence characters
                    )
                    ([^`\n]*?)?                 #4 Code language [optional]
                    (?:
                        \n(.*?)                 #5 Code block
                    )?
                    (?:(?<=\n)([ ]{0,3}\2\3*[ ]*)|\z)  #  Closing fence or end of document
                )$
            }msx',
            function (Text $whole, Text $whitespace, Text $fence, Text $fenceChar, Text $lang, Text $code = null) use ($target) {
                $leading = $whitespace->getLength();
                $code = $code ?: new Text();

                $language = new Text(explode(' ', $lang->trim())[0]);
                $language->decodeEntities();

                // Remove all leading whitespace from content lines
                if ($leading > 0) {
                    $code->replace("/^[ ]{0,$leading}/m", '');
                }

                $target->addChild(new CodeBlock($code, $language));
            },
            function (Text $part) use ($target) {
                $this->next->parseBlock($part, $target);
            }
        );
    }