Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php class Parsedown { const version = "\61\56\70\x2e\x30\55\x62\x65\164\x61\x2d\x37"; f..

Decoded Output download

<?php
 class Parsedown { const version = "1.8.0-beta-7"; function text($text) { $Elements = $this->textElements($text); $markup = $this->elements($Elements); $markup = trim($markup, "
"); return $markup; } protected function textElements($text) { $this->DefinitionData = array(); $text = str_replace(array("
\xa", "\xd"), "
", $text); $text = trim($text, "
"); $lines = explode("\xa", $text); return $this->linesElements($lines); } function setBreaksEnabled($breaksEnabled) { $this->breaksEnabled = $breaksEnabled; return $this; } protected $breaksEnabled; function setMarkupEscaped($markupEscaped) { $this->markupEscaped = $markupEscaped; return $this; } protected $markupEscaped; function setUrlsLinked($urlsLinked) { $this->urlsLinked = $urlsLinked; return $this; } protected $urlsLinked = true; function setSafeMode($safeMode) { $this->safeMode = (bool) $safeMode; return $this; } protected $safeMode; function setStrictMode($strictMode) { $this->strictMode = (bool) $strictMode; return $this; } protected $strictMode; protected $safeLinksWhitelist = array("http://", "https://", "ftp://", "ftps://", "mailto:", "tel:", "data:image/png;base64,", "data:image/gif;base64,", "data:image/jpeg;base64,", "irc:", "ircs:", "git:", "ssh:", "news:", "steam:"); protected $BlockTypes = array("#" => array("Header"), "*" => array("Rule", "List"), "+" => array("List"), "-" => array("SetextHeader", "Table", "Rule", "List"), "0" => array("List"), "1" => array("List"), "2" => array("List"), "3" => array("List"), "4" => array("List"), "5" => array("List"), "6" => array("List"), "7" => array("List"), "8" => array("List"), "9" => array("List"), ":" => array("Table"), "<" => array("Comment", "Markup"), "=" => array("SetextHeader"), ">" => array("Quote"), "[" => array("Reference"), "_" => array("Rule"), "`" => array("FencedCode"), "|" => array("Table"), "~" => array("FencedCode")); protected $unmarkedBlockTypes = array("Code"); protected function lines(array $lines) { return $this->elements($this->linesElements($lines)); } protected function linesElements(array $lines) { $Elements = array(); $CurrentBlock = null; foreach ($lines as $line) { if (chop($line) === '') { if (isset($CurrentBlock)) { $CurrentBlock["interrupted"] = isset($CurrentBlock["interrupted"]) ? $CurrentBlock["interrupted"] + 1 : 1; } continue; } while (($beforeTab = strstr($line, "	", true)) !== false) { $shortage = 4 - mb_strlen($beforeTab, "utf-8") % 4; $line = $beforeTab . str_repeat(" ", $shortage) . substr($line, strlen($beforeTab) + 1); } $indent = strspn($line, " "); $text = $indent > 0 ? substr($line, $indent) : $line; $Line = array("body" => $line, "indent" => $indent, "text" => $text); if (isset($CurrentBlock["continuable"])) { $methodName = "block" . $CurrentBlock["type"] . "Continue"; $Block = $this->{$methodName}($Line, $CurrentBlock); if (isset($Block)) { $CurrentBlock = $Block; continue; } else { if ($this->isBlockCompletable($CurrentBlock["type"])) { $methodName = "block" . $CurrentBlock["type"] . "Complete"; $CurrentBlock = $this->{$methodName}($CurrentBlock); } } } $marker = $text[0]; $blockTypes = $this->unmarkedBlockTypes; if (isset($this->BlockTypes[$marker])) { foreach ($this->BlockTypes[$marker] as $blockType) { $blockTypes[] = $blockType; } } foreach ($blockTypes as $blockType) { $Block = $this->{"block{$blockType}"}($Line, $CurrentBlock); if (isset($Block)) { $Block["type"] = $blockType; if (!isset($Block["identified"])) { if (isset($CurrentBlock)) { $Elements[] = $this->extractElement($CurrentBlock); } $Block["identified"] = true; } if ($this->isBlockContinuable($blockType)) { $Block["continuable"] = true; } $CurrentBlock = $Block; continue 2; } } if (isset($CurrentBlock) and $CurrentBlock["type"] === "Paragraph") { $Block = $this->paragraphContinue($Line, $CurrentBlock); } if (isset($Block)) { $CurrentBlock = $Block; } else { if (isset($CurrentBlock)) { $Elements[] = $this->extractElement($CurrentBlock); } $CurrentBlock = $this->paragraph($Line); $CurrentBlock["identified"] = true; } } if (isset($CurrentBlock["continuable"]) and $this->isBlockCompletable($CurrentBlock["type"])) { $methodName = "block" . $CurrentBlock["type"] . "Complete"; $CurrentBlock = $this->{$methodName}($CurrentBlock); } if (isset($CurrentBlock)) { $Elements[] = $this->extractElement($CurrentBlock); } return $Elements; } protected function extractElement(array $Component) { if (!isset($Component["element"])) { if (isset($Component["markup"])) { $Component["element"] = array("rawHtml" => $Component["markup"]); } elseif (isset($Component["hidden"])) { $Component["element"] = array(); } } return $Component["element"]; } protected function isBlockContinuable($Type) { return method_exists($this, "block" . $Type . "Continue"); } protected function isBlockCompletable($Type) { return method_exists($this, "block" . $Type . "Complete"); } protected function blockCode($Line, $Block = null) { if (isset($Block) and $Block["type"] === "Paragraph" and !isset($Block["interrupted"])) { return; } if ($Line["indent"] >= 4) { $text = substr($Line["body"], 4); $Block = array("element" => array("name" => "pre", "element" => array("name" => "code", "text" => $text))); return $Block; } } protected function blockCodeContinue($Line, $Block) { if ($Line["indent"] >= 4) { if (isset($Block["interrupted"])) { $Block["element"]["element"]["text"] .= str_repeat("\xa", $Block["interrupted"]); unset($Block["interrupted"]); } $Block["element"]["element"]["text"] .= "
"; $text = substr($Line["body"], 4); $Block["element"]["element"]["text"] .= $text; return $Block; } } protected function blockCodeComplete($Block) { return $Block; } protected function blockComment($Line) { if ($this->markupEscaped or $this->safeMode) { return; } if (strpos($Line["text"], "<!--") === 0) { $Block = array("element" => array("rawHtml" => $Line["body"], "autobreak" => true)); if (strpos($Line["text"], "-->") !== false) { $Block["closed"] = true; } return $Block; } } protected function blockCommentContinue($Line, array $Block) { if (isset($Block["closed"])) { return; } $Block["element"]["rawHtml"] .= "
" . $Line["body"]; if (strpos($Line["text"], "-->") !== false) { $Block["closed"] = true; } return $Block; } protected function blockFencedCode($Line) { $marker = $Line["text"][0]; $openerLength = strspn($Line["text"], $marker); if ($openerLength < 3) { return; } $infostring = trim(substr($Line["text"], $openerLength), "\x9 "); if (strpos($infostring, "`") !== false) { return; } $Element = array("name" => "code", "text" => ''); if ($infostring !== '') { $language = substr($infostring, 0, strcspn($infostring, " 	\xa\xd")); $Element["attributes"] = array("class" => "language-{$language}"); } $Block = array("char" => $marker, "openerLength" => $openerLength, "element" => array("name" => "pre", "element" => $Element)); return $Block; } protected function blockFencedCodeContinue($Line, $Block) { if (isset($Block["complete"])) { return; } if (isset($Block["interrupted"])) { $Block["element"]["element"]["text"] .= str_repeat("\xa", $Block["interrupted"]); unset($Block["interrupted"]); } if (($len = strspn($Line["text"], $Block["char"])) >= $Block["openerLength"] and chop(substr($Line["text"], $len), " ") === '') { $Block["element"]["element"]["text"] = substr($Block["element"]["element"]["text"], 1); $Block["complete"] = true; return $Block; } $Block["element"]["element"]["text"] .= "
" . $Line["body"]; return $Block; } protected function blockFencedCodeComplete($Block) { return $Block; } protected function blockHeader($Line) { $level = strspn($Line["text"], "#"); if ($level > 6) { return; } $text = trim($Line["text"], "#"); if ($this->strictMode and isset($text[0]) and $text[0] !== " ") { return; } $text = trim($text, " "); $Block = array("element" => array("name" => "h" . $level, "handler" => array("function" => "lineElements", "argument" => $text, "destination" => "elements"))); return $Block; } protected function blockList($Line, array $CurrentBlock = null) { list($name, $pattern) = $Line["text"][0] <= "-" ? array("ul", "[*+-]") : array("ol", "[0-9]{1,9}+[.\)]"); if (preg_match("/^(" . $pattern . "([ ]++|$))(.*+)/", $Line["text"], $matches)) { $contentIndent = strlen($matches[2]); if ($contentIndent >= 5) { $contentIndent -= 1; $matches[1] = substr($matches[1], 0, -$contentIndent); $matches[3] = str_repeat(" ", $contentIndent) . $matches[3]; } elseif ($contentIndent === 0) { $matches[1] .= " "; } $markerWithoutWhitespace = strstr($matches[1], " ", true); $Block = array("indent" => $Line["indent"], "pattern" => $pattern, "data" => array("type" => $name, "marker" => $matches[1], "markerType" => $name === "ul" ? $markerWithoutWhitespace : substr($markerWithoutWhitespace, -1)), "element" => array("name" => $name, "elements" => array())); $Block["data"]["markerTypeRegex"] = preg_quote($Block["data"]["markerType"], "/"); if ($name === "ol") { $listStart = ltrim(strstr($matches[1], $Block["data"]["markerType"], true), "0") ?: "0"; if ($listStart !== "1") { if (isset($CurrentBlock) and $CurrentBlock["type"] === "Paragraph" and !isset($CurrentBlock["interrupted"])) { return; } $Block["element"]["attributes"] = array("start" => $listStart); } } $Block["li"] = array("name" => "li", "handler" => array("function" => "li", "argument" => !empty($matches[3]) ? array($matches[3]) : array(), "destination" => "elements")); $Block["element"]["elements"][] =& $Block["li"]; return $Block; } } protected function blockListContinue($Line, array $Block) { if (isset($Block["interrupted"]) and empty($Block["li"]["handler"]["argument"])) { return null; } $requiredIndent = $Block["indent"] + strlen($Block["data"]["marker"]); if ($Line["indent"] < $requiredIndent and ($Block["data"]["type"] === "ol" and preg_match("/^[0-9]++" . $Block["data"]["markerTypeRegex"] . "(?:[ ]++(.*)|$)/", $Line["text"], $matches) or $Block["data"]["type"] === "ul" and preg_match("/^" . $Block["data"]["markerTypeRegex"] . "(?:[ ]++(.*)|$)/", $Line["text"], $matches))) { if (isset($Block["interrupted"])) { $Block["li"]["handler"]["argument"][] = ''; $Block["loose"] = true; unset($Block["interrupted"]); } unset($Block["li"]); $text = isset($matches[1]) ? $matches[1] : ''; $Block["indent"] = $Line["indent"]; $Block["li"] = array("name" => "li", "handler" => array("function" => "li", "argument" => array($text), "destination" => "elements")); $Block["element"]["elements"][] =& $Block["li"]; return $Block; } elseif ($Line["indent"] < $requiredIndent and $this->blockList($Line)) { return null; } if ($Line["text"][0] === "[" and $this->blockReference($Line)) { return $Block; } if ($Line["indent"] >= $requiredIndent) { if (isset($Block["interrupted"])) { $Block["li"]["handler"]["argument"][] = ''; $Block["loose"] = true; unset($Block["interrupted"]); } $text = substr($Line["body"], $requiredIndent); $Block["li"]["handler"]["argument"][] = $text; return $Block; } if (!isset($Block["interrupted"])) { $text = preg_replace("/^[ ]{0," . $requiredIndent . "}+/", '', $Line["body"]); $Block["li"]["handler"]["argument"][] = $text; return $Block; } } protected function blockListComplete(array $Block) { if (isset($Block["loose"])) { foreach ($Block["element"]["elements"] as &$li) { if (end($li["handler"]["argument"]) !== '') { $li["handler"]["argument"][] = ''; } } } return $Block; } protected function blockQuote($Line) { if (preg_match("/^>[ ]?+(.*+)/", $Line["text"], $matches)) { $Block = array("element" => array("name" => "blockquote", "handler" => array("function" => "linesElements", "argument" => (array) $matches[1], "destination" => "elements"))); return $Block; } } protected function blockQuoteContinue($Line, array $Block) { if (isset($Block["interrupted"])) { return; } if ($Line["text"][0] === ">" and preg_match("/^>[ ]?+(.*+)/", $Line["text"], $matches)) { $Block["element"]["handler"]["argument"][] = $matches[1]; return $Block; } if (!isset($Block["interrupted"])) { $Block["element"]["handler"]["argument"][] = $Line["text"]; return $Block; } } protected function blockRule($Line) { $marker = $Line["text"][0]; if (substr_count($Line["text"], $marker) >= 3 and chop($Line["text"], " {$marker}") === '') { $Block = array("element" => array("name" => "hr")); return $Block; } } protected function blockSetextHeader($Line, array $Block = null) { if (!isset($Block) or $Block["type"] !== "Paragraph" or isset($Block["interrupted"])) { return; } if ($Line["indent"] < 4 and chop(chop($Line["text"], " "), $Line["text"][0]) === '') { $Block["element"]["name"] = $Line["text"][0] === "=" ? "h1" : "h2"; return $Block; } } protected function blockMarkup($Line) { if ($this->markupEscaped or $this->safeMode) { return; } if (preg_match("/^<[\/]?+(\w*)(?:[ ]*+" . $this->regexHtmlAttribute . ")*+[ ]*+(\/)?>/", $Line["text"], $matches)) { $element = strtolower($matches[1]); if (in_array($element, $this->textLevelElements)) { return; } $Block = array("name" => $matches[1], "element" => array("rawHtml" => $Line["text"], "autobreak" => true)); return $Block; } } protected function blockMarkupContinue($Line, array $Block) { if (isset($Block["closed"]) or isset($Block["interrupted"])) { return; } $Block["element"]["rawHtml"] .= "\xa" . $Line["body"]; return $Block; } protected function blockReference($Line) { if (strpos($Line["text"], "]") !== false and preg_match("/^\[(.+?)\]:[ ]*+<?(\S+?)>?(?:[ ]+["'(](.+)["')])?[ ]*+$/", $Line["text"], $matches)) { $id = strtolower($matches[1]); $Data = array("url" => $matches[2], "title" => isset($matches[3]) ? $matches[3] : null); $this->DefinitionData["Reference"][$id] = $Data; $Block = array("element" => array()); return $Block; } } protected function blockTable($Line, array $Block = null) { if (!isset($Block) or $Block["type"] !== "Paragraph" or isset($Block["interrupted"])) { return; } if (strpos($Block["element"]["handler"]["argument"], "|") === false and strpos($Line["text"], "|") === false and strpos($Line["text"], ":") === false or strpos($Block["element"]["handler"]["argument"], "\xa") !== false) { return; } if (chop($Line["text"], " -:|") !== '') { return; } $alignments = array(); $divider = $Line["text"]; $divider = trim($divider); $divider = trim($divider, "|"); $dividerCells = explode("|", $divider); foreach ($dividerCells as $dividerCell) { $dividerCell = trim($dividerCell); if ($dividerCell === '') { return; } $alignment = null; if ($dividerCell[0] === ":") { $alignment = "left"; } if (substr($dividerCell, -1) === ":") { $alignment = $alignment === "left" ? "center" : "right"; } $alignments[] = $alignment; } $HeaderElements = array(); $header = $Block["element"]["handler"]["argument"]; $header = trim($header); $header = trim($header, "|"); $headerCells = explode("|", $header); if (count($headerCells) !== count($alignments)) { return; } foreach ($headerCells as $index => $headerCell) { $headerCell = trim($headerCell); $HeaderElement = array("name" => "th", "handler" => array("function" => "lineElements", "argument" => $headerCell, "destination" => "elements")); if (isset($alignments[$index])) { $alignment = $alignments[$index]; $HeaderElement["attributes"] = array("style" => "text-align: {$alignment};"); } $HeaderElements[] = $HeaderElement; } $Block = array("alignments" => $alignments, "identified" => true, "element" => array("name" => "table", "elements" => array())); $Block["element"]["elements"][] = array("name" => "thead"); $Block["element"]["elements"][] = array("name" => "tbody", "elements" => array()); $Block["element"]["elements"][0]["elements"][] = array("name" => "tr", "elements" => $HeaderElements); return $Block; } protected function blockTableContinue($Line, array $Block) { if (isset($Block["interrupted"])) { return; } if (count($Block["alignments"]) === 1 or $Line["text"][0] === "|" or strpos($Line["text"], "|")) { $Elements = array(); $row = $Line["text"]; $row = trim($row); $row = trim($row, "|"); preg_match_all("/(?:(\\[|])|[^|`]|`[^`]++`|`)++/", $row, $matches); $cells = array_slice($matches[0], 0, count($Block["alignments"])); foreach ($cells as $index => $cell) { $cell = trim($cell); $Element = array("name" => "td", "handler" => array("function" => "lineElements", "argument" => $cell, "destination" => "elements")); if (isset($Block["alignments"][$index])) { $Element["attributes"] = array("style" => "text-align: " . $Block["alignments"][$index] . ";"); } $Elements[] = $Element; } $Element = array("name" => "tr", "elements" => $Elements); $Block["element"]["elements"][1]["elements"][] = $Element; return $Block; } } protected function paragraph($Line) { return array("type" => "Paragraph", "element" => array("name" => "p", "handler" => array("function" => "lineElements", "argument" => $Line["text"], "destination" => "elements"))); } protected function paragraphContinue($Line, array $Block) { if (isset($Block["interrupted"])) { return; } $Block["element"]["handler"]["argument"] .= "\xa" . $Line["text"]; return $Block; } protected $InlineTypes = array("!" => array("Image"), "&" => array("SpecialCharacter"), "*" => array("Emphasis"), ":" => array("Url"), "<" => array("UrlTag", "EmailTag", "Markup"), "[" => array("Link"), "_" => array("Emphasis"), "`" => array("Code"), "~" => array("Strikethrough"), "\" => array("EscapeSequence")); protected $inlineMarkerList = "!*_&[:<`~\"; public function line($text, $nonNestables = array()) { return $this->elements($this->lineElements($text, $nonNestables)); } protected function lineElements($text, $nonNestables = array()) { $text = str_replace(array("\xd
", "\xd"), "
", $text); $Elements = array(); $nonNestables = empty($nonNestables) ? array() : array_combine($nonNestables, $nonNestables); while ($excerpt = strpbrk($text, $this->inlineMarkerList)) { $marker = $excerpt[0]; $markerPosition = strlen($text) - strlen($excerpt); $Excerpt = array("text" => $excerpt, "context" => $text); foreach ($this->InlineTypes[$marker] as $inlineType) { if (isset($nonNestables[$inlineType])) { continue; } $Inline = $this->{"inline{$inlineType}"}($Excerpt); if (!isset($Inline)) { continue; } if (isset($Inline["position"]) and $Inline["position"] > $markerPosition) { continue; } if (!isset($Inline["position"])) { $Inline["position"] = $markerPosition; } $Inline["element"]["nonNestables"] = isset($Inline["element"]["nonNestables"]) ? array_merge($Inline["element"]["nonNestables"], $nonNestables) : $nonNestables; $unmarkedText = substr($text, 0, $Inline["position"]); $InlineText = $this->inlineText($unmarkedText); $Elements[] = $InlineText["element"]; $Elements[] = $this->extractElement($Inline); $text = substr($text, $Inline["position"] + $Inline["extent"]); continue 2; } $unmarkedText = substr($text, 0, $markerPosition + 1); $InlineText = $this->inlineText($unmarkedText); $Elements[] = $InlineText["element"]; $text = substr($text, $markerPosition + 1); } $InlineText = $this->inlineText($text); $Elements[] = $InlineText["element"]; foreach ($Elements as &$Element) { if (!isset($Element["autobreak"])) { $Element["autobreak"] = false; } } return $Elements; } protected function inlineText($text) { $Inline = array("extent" => strlen($text), "element" => array()); $Inline["element"]["elements"] = self::pregReplaceElements($this->breaksEnabled ? "/[ ]*+\n/" : "/(?:[ ]*+\\|[ ]{2,}+)\n/", array(array("name" => "br"), array("text" => "\xa")), $text); return $Inline; } protected function inlineCode($Excerpt) { $marker = $Excerpt["text"][0]; if (preg_match("/^([" . $marker . "]++)[ ]*+(.+?)[ ]*+(?<![" . $marker . "])\1(?!" . $marker . ")/s", $Excerpt["text"], $matches)) { $text = $matches[2]; $text = preg_replace("/[ ]*+\n/", " ", $text); return array("extent" => strlen($matches[0]), "element" => array("name" => "code", "text" => $text)); } } protected function inlineEmailTag($Excerpt) { $hostnameLabel = "[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?"; $commonMarkEmail = "[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]++@" . $hostnameLabel . "(?:\." . $hostnameLabel . ")*"; if (strpos($Excerpt["text"], ">") !== false and preg_match("/^<((mailto:)?{$commonMarkEmail})>/i", $Excerpt["text"], $matches)) { $url = $matches[1]; if (!isset($matches[2])) { $url = "mailto:{$url}"; } return array("extent" => strlen($matches[0]), "element" => array("name" => "a", "text" => $matches[1], "attributes" => array("href" => $url))); } } protected function inlineEmphasis($Excerpt) { if (!isset($Excerpt["text"][1])) { return; } $marker = $Excerpt["text"][0]; if ($Excerpt["text"][1] === $marker and preg_match($this->StrongRegex[$marker], $Excerpt["text"], $matches)) { $emphasis = "strong"; } elseif (preg_match($this->EmRegex[$marker], $Excerpt["text"], $matches)) { $emphasis = "em"; } else { return; } return array("extent" => strlen($matches[0]), "element" => array("name" => $emphasis, "handler" => array("function" => "lineElements", "argument" => $matches[1], "destination" => "elements"))); } protected function inlineEscapeSequence($Excerpt) { if (isset($Excerpt["text"][1]) and in_array($Excerpt["text"][1], $this->specialCharacters)) { return array("element" => array("rawHtml" => $Excerpt["text"][1]), "extent" => 2); } } protected function inlineImage($Excerpt) { if (!isset($Excerpt["text"][1]) or $Excerpt["text"][1] !== "[") { return; } $Excerpt["text"] = substr($Excerpt["text"], 1); $Link = $this->inlineLink($Excerpt); if ($Link === null) { return; } $Inline = array("extent" => $Link["extent"] + 1, "element" => array("name" => "img", "attributes" => array("src" => $Link["element"]["attributes"]["href"], "alt" => $Link["element"]["handler"]["argument"]), "autobreak" => true)); $Inline["element"]["attributes"] += $Link["element"]["attributes"]; unset($Inline["element"]["attributes"]["href"]); return $Inline; } protected function inlineLink($Excerpt) { $Element = array("name" => "a", "handler" => array("function" => "lineElements", "argument" => null, "destination" => "elements"), "nonNestables" => array("Url", "Link"), "attributes" => array("href" => null, "title" => null)); $extent = 0; $remainder = $Excerpt["text"]; if (preg_match("/\[((?:[^][]++|(?R))*+)\]/", $remainder, $matches)) { $Element["handler"]["argument"] = $matches[1]; $extent += strlen($matches[0]); $remainder = substr($remainder, $extent); } else { return; } if (preg_match("/^[(]\s*+((?:[^ ()]++|[(][^ )]+[)])++)(?:[ ]+("[^"]*+"|'[^']*+'))?\s*+[)]/", $remainder, $matches)) { $Element["attributes"]["href"] = $matches[1]; if (isset($matches[2])) { $Element["attributes"]["title"] = substr($matches[2], 1, -1); } $extent += strlen($matches[0]); } else { if (preg_match("/^\s*\[(.*?)\]/", $remainder, $matches)) { $definition = strlen($matches[1]) ? $matches[1] : $Element["handler"]["argument"]; $definition = strtolower($definition); $extent += strlen($matches[0]); } else { $definition = strtolower($Element["handler"]["argument"]); } if (!isset($this->DefinitionData["Reference"][$definition])) { return; } $Definition = $this->DefinitionData["Reference"][$definition]; $Element["attributes"]["href"] = $Definition["url"]; $Element["attributes"]["title"] = $Definition["title"]; } return array("extent" => $extent, "element" => $Element); } protected function inlineMarkup($Excerpt) { if ($this->markupEscaped or $this->safeMode or strpos($Excerpt["text"], ">") === false) { return; } if ($Excerpt["text"][1] === "/" and preg_match("/^<\/\w[\w-]*+[ ]*+>/s", $Excerpt["text"], $matches)) { return array("element" => array("rawHtml" => $matches[0]), "extent" => strlen($matches[0])); } if ($Excerpt["text"][1] === "!" and preg_match("/^<!---?[^>-](?:-?+[^-])*-->/s", $Excerpt["text"], $matches)) { return array("element" => array("rawHtml" => $matches[0]), "extent" => strlen($matches[0])); } if ($Excerpt["text"][1] !== " " and preg_match("/^<\w[\w-]*+(?:[ ]*+" . $this->regexHtmlAttribute . ")*+[ ]*+\/?>/s", $Excerpt["text"], $matches)) { return array("element" => array("rawHtml" => $matches[0]), "extent" => strlen($matches[0])); } } protected function inlineSpecialCharacter($Excerpt) { if (substr($Excerpt["text"], 1, 1) !== " " and strpos($Excerpt["text"], ";") !== false and preg_match("/^&(#?+[0-9a-zA-Z]++);/", $Excerpt["text"], $matches)) { return array("element" => array("rawHtml" => "&" . $matches[1] . ";"), "extent" => strlen($matches[0])); } return; } protected function inlineStrikethrough($Excerpt) { if (!isset($Excerpt["text"][1])) { return; } if ($Excerpt["text"][1] === "~" and preg_match("/^~~(?=\S)(.+?)(?<=\S)~~/", $Excerpt["text"], $matches)) { return array("extent" => strlen($matches[0]), "element" => array("name" => "del", "handler" => array("function" => "lineElements", "argument" => $matches[1], "destination" => "elements"))); } } protected function inlineUrl($Excerpt) { if ($this->urlsLinked !== true or !isset($Excerpt["text"][2]) or $Excerpt["text"][2] !== "/") { return; } if (strpos($Excerpt["context"], "http") !== false and preg_match("/\bhttps?+:[\/]{2}[^\s<]+\b\/*+/ui", $Excerpt["context"], $matches, PREG_OFFSET_CAPTURE)) { $url = $matches[0][0]; $Inline = array("extent" => strlen($matches[0][0]), "position" => $matches[0][1], "element" => array("name" => "a", "text" => $url, "attributes" => array("href" => $url))); return $Inline; } } protected function inlineUrlTag($Excerpt) { if (strpos($Excerpt["text"], ">") !== false and preg_match("/^<(\w++:\/{2}[^ >]++)>/i", $Excerpt["text"], $matches)) { $url = $matches[1]; return array("extent" => strlen($matches[0]), "element" => array("name" => "a", "text" => $url, "attributes" => array("href" => $url))); } } protected function unmarkedText($text) { $Inline = $this->inlineText($text); return $this->element($Inline["element"]); } protected function handle(array $Element) { if (isset($Element["handler"])) { if (!isset($Element["nonNestables"])) { $Element["nonNestables"] = array(); } if (is_string($Element["handler"])) { $function = $Element["handler"]; $argument = $Element["text"]; unset($Element["text"]); $destination = "rawHtml"; } else { $function = $Element["handler"]["function"]; $argument = $Element["handler"]["argument"]; $destination = $Element["handler"]["destination"]; } $Element[$destination] = $this->{$function}($argument, $Element["nonNestables"]); if ($destination === "handler") { $Element = $this->handle($Element); } unset($Element["handler"]); } return $Element; } protected function handleElementRecursive(array $Element) { return $this->elementApplyRecursive(array($this, "handle"), $Element); } protected function handleElementsRecursive(array $Elements) { return $this->elementsApplyRecursive(array($this, "handle"), $Elements); } protected function elementApplyRecursive($closure, array $Element) { $Element = call_user_func($closure, $Element); if (isset($Element["elements"])) { $Element["elements"] = $this->elementsApplyRecursive($closure, $Element["elements"]); } elseif (isset($Element["element"])) { $Element["element"] = $this->elementApplyRecursive($closure, $Element["element"]); } return $Element; } protected function elementApplyRecursiveDepthFirst($closure, array $Element) { if (isset($Element["elements"])) { $Element["elements"] = $this->elementsApplyRecursiveDepthFirst($closure, $Element["elements"]); } elseif (isset($Element["element"])) { $Element["element"] = $this->elementsApplyRecursiveDepthFirst($closure, $Element["element"]); } $Element = call_user_func($closure, $Element); return $Element; } protected function elementsApplyRecursive($closure, array $Elements) { foreach ($Elements as &$Element) { $Element = $this->elementApplyRecursive($closure, $Element); } return $Elements; } protected function elementsApplyRecursiveDepthFirst($closure, array $Elements) { foreach ($Elements as &$Element) { $Element = $this->elementApplyRecursiveDepthFirst($closure, $Element); } return $Elements; } protected function element(array $Element) { if ($this->safeMode) { $Element = $this->sanitiseElement($Element); } $Element = $this->handle($Element); $hasName = isset($Element["name"]); $markup = ''; if ($hasName) { $markup .= "<" . $Element["name"]; if (isset($Element["attributes"])) { foreach ($Element["attributes"] as $name => $value) { if ($value === null) { continue; } $markup .= " {$name}="" . self::escape($value) . """; } } } $permitRawHtml = false; if (isset($Element["text"])) { $text = $Element["text"]; } elseif (isset($Element["rawHtml"])) { $text = $Element["rawHtml"]; $allowRawHtmlInSafeMode = isset($Element["allowRawHtmlInSafeMode"]) && $Element["allowRawHtmlInSafeMode"]; $permitRawHtml = !$this->safeMode || $allowRawHtmlInSafeMode; } $hasContent = isset($text) || isset($Element["element"]) || isset($Element["elements"]); if ($hasContent) { $markup .= $hasName ? ">" : ''; if (isset($Element["elements"])) { $markup .= $this->elements($Element["elements"]); } elseif (isset($Element["element"])) { $markup .= $this->element($Element["element"]); } else { if (!$permitRawHtml) { $markup .= self::escape($text, true); } else { $markup .= $text; } } $markup .= $hasName ? "</" . $Element["name"] . ">" : ''; } elseif ($hasName) { $markup .= " />"; } return $markup; } protected function elements(array $Elements) { $markup = ''; $autoBreak = true; foreach ($Elements as $Element) { if (empty($Element)) { continue; } $autoBreakNext = isset($Element["autobreak"]) ? $Element["autobreak"] : isset($Element["name"]); $autoBreak = !$autoBreak ? $autoBreak : $autoBreakNext; $markup .= ($autoBreak ? "\xa" : '') . $this->element($Element); $autoBreak = $autoBreakNext; } $markup .= $autoBreak ? "
" : ''; return $markup; } protected function li($lines) { $Elements = $this->linesElements($lines); if (!in_array('', $lines) and isset($Elements[0]) and isset($Elements[0]["name"]) and $Elements[0]["name"] === "p") { unset($Elements[0]["name"]); } return $Elements; } protected static function pregReplaceElements($regexp, $Elements, $text) { $newElements = array(); while (preg_match($regexp, $text, $matches, PREG_OFFSET_CAPTURE)) { $offset = $matches[0][1]; $before = substr($text, 0, $offset); $after = substr($text, $offset + strlen($matches[0][0])); $newElements[] = array("text" => $before); foreach ($Elements as $Element) { $newElements[] = $Element; } $text = $after; } $newElements[] = array("text" => $text); return $newElements; } function parse($text) { $markup = $this->text($text); return $markup; } protected function sanitiseElement(array $Element) { static $goodAttribute = "/^[a-zA-Z0-9][a-zA-Z0-9-_]*+$/"; static $safeUrlNameToAtt = array("a" => "href", "img" => "src"); if (!isset($Element["name"])) { unset($Element["attributes"]); return $Element; } if (isset($safeUrlNameToAtt[$Element["name"]])) { $Element = $this->filterUnsafeUrlInAttribute($Element, $safeUrlNameToAtt[$Element["name"]]); } if (!empty($Element["attributes"])) { foreach ($Element["attributes"] as $att => $val) { if (!preg_match($goodAttribute, $att)) { unset($Element["attributes"][$att]); } elseif (self::striAtStart($att, "on")) { unset($Element["attributes"][$att]); } } } return $Element; } protected function filterUnsafeUrlInAttribute(array $Element, $attribute) { foreach ($this->safeLinksWhitelist as $scheme) { if (self::striAtStart($Element["attributes"][$attribute], $scheme)) { return $Element; } } $Element["attributes"][$attribute] = str_replace(":", "%3A", $Element["attributes"][$attribute]); return $Element; } protected static function escape($text, $allowQuotes = false) { return htmlspecialchars($text, $allowQuotes ? ENT_NOQUOTES : ENT_QUOTES, "UTF-8"); } protected static function striAtStart($string, $needle) { $len = strlen($needle); if ($len > strlen($string)) { return false; } else { return strtolower(substr($string, 0, $len)) === strtolower($needle); } } static function instance($name = "default") { if (isset(self::$instances[$name])) { return self::$instances[$name]; } $instance = new static(); self::$instances[$name] = $instance; return $instance; } private static $instances = array(); protected $DefinitionData; protected $specialCharacters = array("\", "`", "*", "_", "{", "}", "[", "]", "(", ")", ">", "#", "+", "-", ".", "!", "|", "~"); protected $StrongRegex = array("*" => "/^[*]{2}((?:\\\*|[^*]|[*][^*]*+[*])+?)[*]{2}(?![*])/s", "_" => "/^__((?:\\_|[^_]|_[^_]*+_)+?)__(?!_)/us"); protected $EmRegex = array("*" => "/^[*]((?:\\\*|[^*]|[*][*][^*]+?[*][*])+?)[*](?![*])/s", "_" => "/^_((?:\\_|[^_]|__[^_]*__)+?)_(?!_)\b/us"); protected $regexHtmlAttribute = "[a-zA-Z_:][\w:.-]*+(?:\s*+=\s*+(?:[^"'=<>`\s]+|"[^"]*+"|'[^']*+'))?+"; protected $voidElements = array("area", "base", "br", "col", "command", "embed", "hr", "img", "input", "link", "meta", "param", "source"); protected $textLevelElements = array("a", "br", "bdo", "abbr", "blink", "nextid", "acronym", "basefont", "b", "em", "big", "cite", "small", "spacer", "listing", "i", "rp", "del", "code", "strike", "marquee", "q", "rt", "ins", "font", "strong", "s", "tt", "kbd", "mark", "u", "xm", "sub", "nobr", "sup", "ruby", "var", "span", "wbr", "time"); } ?>

Did this file decode correctly?

Original Code

<?php
 class Parsedown { const version = "\61\56\70\x2e\x30\55\x62\x65\164\x61\x2d\x37"; function text($text) { $Elements = $this->textElements($text); $markup = $this->elements($Elements); $markup = trim($markup, "\12"); return $markup; } protected function textElements($text) { $this->DefinitionData = array(); $text = str_replace(array("\15\xa", "\xd"), "\12", $text); $text = trim($text, "\12"); $lines = explode("\xa", $text); return $this->linesElements($lines); } function setBreaksEnabled($breaksEnabled) { $this->breaksEnabled = $breaksEnabled; return $this; } protected $breaksEnabled; function setMarkupEscaped($markupEscaped) { $this->markupEscaped = $markupEscaped; return $this; } protected $markupEscaped; function setUrlsLinked($urlsLinked) { $this->urlsLinked = $urlsLinked; return $this; } protected $urlsLinked = true; function setSafeMode($safeMode) { $this->safeMode = (bool) $safeMode; return $this; } protected $safeMode; function setStrictMode($strictMode) { $this->strictMode = (bool) $strictMode; return $this; } protected $strictMode; protected $safeLinksWhitelist = array("\x68\x74\164\160\72\x2f\x2f", "\x68\164\164\160\x73\72\x2f\57", "\x66\164\160\x3a\57\x2f", "\x66\x74\x70\163\x3a\57\x2f", "\x6d\141\151\154\164\x6f\x3a", "\164\x65\154\72", "\x64\141\x74\141\x3a\151\155\141\x67\x65\57\x70\x6e\x67\73\142\x61\163\x65\66\x34\x2c", "\x64\x61\164\x61\72\151\155\x61\x67\x65\57\147\151\x66\x3b\x62\141\163\145\x36\x34\54", "\x64\x61\164\x61\x3a\x69\x6d\x61\147\x65\x2f\x6a\x70\145\147\x3b\x62\141\163\145\x36\64\x2c", "\x69\x72\x63\x3a", "\x69\x72\x63\x73\72", "\147\x69\x74\x3a", "\163\x73\150\x3a", "\x6e\x65\x77\x73\x3a", "\163\x74\x65\141\x6d\72"); protected $BlockTypes = array("\x23" => array("\110\x65\141\x64\x65\162"), "\52" => array("\x52\x75\x6c\x65", "\114\151\x73\x74"), "\x2b" => array("\114\x69\x73\x74"), "\55" => array("\123\x65\164\145\x78\x74\x48\x65\141\x64\145\162", "\x54\141\x62\154\145", "\x52\x75\x6c\145", "\114\x69\163\x74"), "\x30" => array("\x4c\151\163\164"), "\x31" => array("\x4c\151\x73\x74"), "\62" => array("\114\151\163\x74"), "\63" => array("\114\151\x73\164"), "\x34" => array("\114\151\x73\x74"), "\65" => array("\x4c\151\x73\x74"), "\x36" => array("\114\151\163\x74"), "\67" => array("\x4c\151\163\164"), "\70" => array("\x4c\151\163\x74"), "\x39" => array("\114\151\163\164"), "\72" => array("\124\x61\142\x6c\x65"), "\x3c" => array("\103\x6f\x6d\155\x65\x6e\164", "\115\x61\x72\153\x75\160"), "\x3d" => array("\123\145\164\145\x78\164\x48\x65\141\144\145\x72"), "\76" => array("\121\x75\157\164\145"), "\x5b" => array("\x52\x65\146\145\x72\x65\x6e\143\x65"), "\137" => array("\122\x75\154\x65"), "\140" => array("\x46\145\x6e\x63\145\x64\103\x6f\144\x65"), "\x7c" => array("\x54\141\x62\x6c\x65"), "\x7e" => array("\x46\x65\156\143\145\x64\103\157\144\145")); protected $unmarkedBlockTypes = array("\103\x6f\144\145"); protected function lines(array $lines) { return $this->elements($this->linesElements($lines)); } protected function linesElements(array $lines) { $Elements = array(); $CurrentBlock = null; foreach ($lines as $line) { if (chop($line) === '') { if (isset($CurrentBlock)) { $CurrentBlock["\151\156\x74\x65\162\162\165\x70\x74\x65\x64"] = isset($CurrentBlock["\x69\156\164\145\x72\x72\x75\160\x74\x65\x64"]) ? $CurrentBlock["\151\156\164\145\x72\x72\x75\x70\x74\x65\x64"] + 1 : 1; } continue; } while (($beforeTab = strstr($line, "\11", true)) !== false) { $shortage = 4 - mb_strlen($beforeTab, "\165\x74\x66\x2d\70") % 4; $line = $beforeTab . str_repeat("\40", $shortage) . substr($line, strlen($beforeTab) + 1); } $indent = strspn($line, "\x20"); $text = $indent > 0 ? substr($line, $indent) : $line; $Line = array("\x62\157\x64\171" => $line, "\x69\156\x64\145\x6e\164" => $indent, "\x74\x65\x78\164" => $text); if (isset($CurrentBlock["\143\x6f\156\164\151\156\x75\x61\x62\154\145"])) { $methodName = "\x62\154\157\143\153" . $CurrentBlock["\164\x79\x70\x65"] . "\x43\x6f\156\x74\151\x6e\165\145"; $Block = $this->{$methodName}($Line, $CurrentBlock); if (isset($Block)) { $CurrentBlock = $Block; continue; } else { if ($this->isBlockCompletable($CurrentBlock["\164\x79\x70\x65"])) { $methodName = "\x62\154\x6f\143\153" . $CurrentBlock["\164\x79\160\x65"] . "\x43\157\155\x70\x6c\145\x74\x65"; $CurrentBlock = $this->{$methodName}($CurrentBlock); } } } $marker = $text[0]; $blockTypes = $this->unmarkedBlockTypes; if (isset($this->BlockTypes[$marker])) { foreach ($this->BlockTypes[$marker] as $blockType) { $blockTypes[] = $blockType; } } foreach ($blockTypes as $blockType) { $Block = $this->{"\142\154\157\x63\153{$blockType}"}($Line, $CurrentBlock); if (isset($Block)) { $Block["\x74\x79\x70\145"] = $blockType; if (!isset($Block["\x69\144\145\x6e\x74\x69\146\151\x65\144"])) { if (isset($CurrentBlock)) { $Elements[] = $this->extractElement($CurrentBlock); } $Block["\151\144\x65\156\164\151\x66\151\x65\144"] = true; } if ($this->isBlockContinuable($blockType)) { $Block["\143\x6f\x6e\x74\151\x6e\x75\141\142\154\145"] = true; } $CurrentBlock = $Block; continue 2; } } if (isset($CurrentBlock) and $CurrentBlock["\x74\171\160\x65"] === "\x50\141\162\x61\147\x72\x61\x70\x68") { $Block = $this->paragraphContinue($Line, $CurrentBlock); } if (isset($Block)) { $CurrentBlock = $Block; } else { if (isset($CurrentBlock)) { $Elements[] = $this->extractElement($CurrentBlock); } $CurrentBlock = $this->paragraph($Line); $CurrentBlock["\151\x64\145\x6e\x74\151\146\151\x65\144"] = true; } } if (isset($CurrentBlock["\x63\x6f\156\164\151\x6e\165\141\142\154\x65"]) and $this->isBlockCompletable($CurrentBlock["\164\171\x70\145"])) { $methodName = "\142\154\157\x63\x6b" . $CurrentBlock["\164\171\x70\145"] . "\x43\x6f\x6d\x70\154\145\x74\x65"; $CurrentBlock = $this->{$methodName}($CurrentBlock); } if (isset($CurrentBlock)) { $Elements[] = $this->extractElement($CurrentBlock); } return $Elements; } protected function extractElement(array $Component) { if (!isset($Component["\145\x6c\145\x6d\x65\156\164"])) { if (isset($Component["\x6d\x61\162\153\165\x70"])) { $Component["\145\154\145\x6d\x65\156\x74"] = array("\x72\141\167\110\x74\155\154" => $Component["\x6d\141\162\153\165\160"]); } elseif (isset($Component["\150\x69\144\x64\x65\156"])) { $Component["\145\x6c\145\x6d\x65\156\164"] = array(); } } return $Component["\145\154\x65\x6d\145\x6e\x74"]; } protected function isBlockContinuable($Type) { return method_exists($this, "\142\x6c\157\x63\153" . $Type . "\103\x6f\156\164\x69\x6e\165\x65"); } protected function isBlockCompletable($Type) { return method_exists($this, "\x62\154\x6f\143\x6b" . $Type . "\x43\x6f\x6d\x70\154\145\164\x65"); } protected function blockCode($Line, $Block = null) { if (isset($Block) and $Block["\x74\x79\160\145"] === "\x50\141\162\141\x67\162\x61\160\x68" and !isset($Block["\151\156\x74\x65\x72\162\165\160\164\x65\144"])) { return; } if ($Line["\151\x6e\x64\x65\156\164"] >= 4) { $text = substr($Line["\x62\157\x64\x79"], 4); $Block = array("\x65\154\x65\x6d\x65\156\x74" => array("\156\x61\x6d\x65" => "\x70\x72\x65", "\145\x6c\145\x6d\x65\156\164" => array("\156\x61\155\145" => "\x63\157\x64\145", "\164\145\x78\x74" => $text))); return $Block; } } protected function blockCodeContinue($Line, $Block) { if ($Line["\x69\x6e\144\x65\x6e\x74"] >= 4) { if (isset($Block["\x69\156\164\145\x72\x72\165\160\164\145\144"])) { $Block["\145\x6c\145\x6d\145\156\x74"]["\145\x6c\x65\155\x65\x6e\x74"]["\x74\145\x78\164"] .= str_repeat("\xa", $Block["\x69\156\x74\x65\x72\162\165\160\164\145\144"]); unset($Block["\x69\156\164\x65\162\x72\165\x70\x74\145\x64"]); } $Block["\x65\x6c\145\155\145\x6e\x74"]["\x65\154\x65\x6d\x65\156\x74"]["\x74\x65\170\164"] .= "\12"; $text = substr($Line["\142\x6f\144\171"], 4); $Block["\x65\154\145\x6d\145\156\x74"]["\145\154\x65\x6d\x65\x6e\x74"]["\164\145\x78\x74"] .= $text; return $Block; } } protected function blockCodeComplete($Block) { return $Block; } protected function blockComment($Line) { if ($this->markupEscaped or $this->safeMode) { return; } if (strpos($Line["\x74\x65\170\x74"], "\74\41\55\x2d") === 0) { $Block = array("\145\x6c\145\x6d\145\x6e\164" => array("\x72\141\167\x48\x74\x6d\x6c" => $Line["\x62\157\144\x79"], "\141\x75\x74\157\x62\162\x65\141\153" => true)); if (strpos($Line["\164\145\x78\x74"], "\x2d\55\76") !== false) { $Block["\143\154\157\x73\x65\x64"] = true; } return $Block; } } protected function blockCommentContinue($Line, array $Block) { if (isset($Block["\x63\x6c\157\x73\145\x64"])) { return; } $Block["\x65\x6c\x65\x6d\145\156\x74"]["\x72\x61\x77\110\x74\x6d\x6c"] .= "\12" . $Line["\142\157\x64\171"]; if (strpos($Line["\164\145\170\x74"], "\x2d\x2d\76") !== false) { $Block["\x63\154\x6f\163\x65\144"] = true; } return $Block; } protected function blockFencedCode($Line) { $marker = $Line["\x74\145\170\x74"][0]; $openerLength = strspn($Line["\x74\145\170\x74"], $marker); if ($openerLength < 3) { return; } $infostring = trim(substr($Line["\x74\145\x78\164"], $openerLength), "\x9\x20"); if (strpos($infostring, "\140") !== false) { return; } $Element = array("\x6e\141\x6d\145" => "\143\157\144\145", "\164\145\x78\x74" => ''); if ($infostring !== '') { $language = substr($infostring, 0, strcspn($infostring, "\40\11\xa\14\xd")); $Element["\x61\x74\x74\x72\151\x62\x75\164\145\163"] = array("\x63\x6c\x61\163\x73" => "\x6c\141\x6e\147\165\x61\147\145\x2d{$language}"); } $Block = array("\143\150\141\x72" => $marker, "\x6f\x70\145\156\x65\x72\114\145\156\x67\164\x68" => $openerLength, "\145\x6c\145\155\145\x6e\x74" => array("\x6e\x61\155\145" => "\x70\x72\x65", "\x65\154\145\155\x65\156\x74" => $Element)); return $Block; } protected function blockFencedCodeContinue($Line, $Block) { if (isset($Block["\143\157\x6d\160\x6c\145\x74\145"])) { return; } if (isset($Block["\151\x6e\x74\x65\x72\x72\165\160\164\145\x64"])) { $Block["\145\154\x65\155\x65\x6e\x74"]["\145\154\x65\x6d\x65\156\x74"]["\164\x65\170\x74"] .= str_repeat("\xa", $Block["\x69\x6e\164\145\x72\x72\165\160\164\145\x64"]); unset($Block["\x69\156\x74\145\162\x72\x75\x70\164\145\x64"]); } if (($len = strspn($Line["\164\145\x78\164"], $Block["\143\150\141\162"])) >= $Block["\x6f\160\x65\156\x65\162\114\145\156\147\x74\x68"] and chop(substr($Line["\x74\x65\x78\x74"], $len), "\40") === '') { $Block["\145\154\x65\x6d\x65\156\x74"]["\x65\154\145\x6d\x65\x6e\x74"]["\x74\x65\x78\164"] = substr($Block["\145\154\x65\155\145\x6e\164"]["\x65\x6c\145\155\x65\x6e\164"]["\164\145\x78\164"], 1); $Block["\x63\x6f\155\160\x6c\x65\x74\145"] = true; return $Block; } $Block["\145\x6c\x65\x6d\x65\156\164"]["\145\154\145\155\145\x6e\164"]["\x74\x65\170\164"] .= "\12" . $Line["\x62\x6f\144\171"]; return $Block; } protected function blockFencedCodeComplete($Block) { return $Block; } protected function blockHeader($Line) { $level = strspn($Line["\164\145\170\x74"], "\x23"); if ($level > 6) { return; } $text = trim($Line["\164\x65\x78\x74"], "\43"); if ($this->strictMode and isset($text[0]) and $text[0] !== "\40") { return; } $text = trim($text, "\40"); $Block = array("\x65\154\x65\155\x65\156\x74" => array("\x6e\141\x6d\145" => "\150" . $level, "\x68\141\156\x64\154\145\162" => array("\146\x75\156\x63\x74\151\157\x6e" => "\x6c\151\156\x65\x45\154\x65\x6d\x65\x6e\x74\163", "\141\162\147\165\155\x65\x6e\164" => $text, "\x64\x65\x73\x74\151\x6e\x61\164\151\x6f\x6e" => "\x65\154\145\x6d\x65\x6e\164\x73"))); return $Block; } protected function blockList($Line, array $CurrentBlock = null) { list($name, $pattern) = $Line["\164\x65\x78\164"][0] <= "\x2d" ? array("\165\x6c", "\x5b\x2a\x2b\x2d\x5d") : array("\157\154", "\x5b\60\x2d\71\135\x7b\x31\54\x39\175\x2b\x5b\x2e\134\x29\x5d"); if (preg_match("\x2f\x5e\x28" . $pattern . "\50\133\x20\135\53\53\x7c\x24\x29\51\x28\56\52\x2b\51\x2f", $Line["\164\x65\x78\164"], $matches)) { $contentIndent = strlen($matches[2]); if ($contentIndent >= 5) { $contentIndent -= 1; $matches[1] = substr($matches[1], 0, -$contentIndent); $matches[3] = str_repeat("\x20", $contentIndent) . $matches[3]; } elseif ($contentIndent === 0) { $matches[1] .= "\40"; } $markerWithoutWhitespace = strstr($matches[1], "\40", true); $Block = array("\x69\156\144\x65\156\x74" => $Line["\x69\x6e\144\x65\156\x74"], "\x70\141\x74\164\145\162\156" => $pattern, "\x64\141\164\x61" => array("\x74\x79\160\145" => $name, "\x6d\x61\162\x6b\x65\x72" => $matches[1], "\155\x61\x72\153\145\162\x54\171\x70\x65" => $name === "\x75\x6c" ? $markerWithoutWhitespace : substr($markerWithoutWhitespace, -1)), "\145\154\145\155\145\x6e\164" => array("\x6e\141\x6d\x65" => $name, "\145\154\x65\155\145\156\164\163" => array())); $Block["\144\141\164\141"]["\x6d\141\x72\x6b\x65\x72\x54\x79\x70\x65\x52\x65\x67\x65\170"] = preg_quote($Block["\144\141\164\141"]["\155\x61\x72\153\145\162\124\171\160\x65"], "\57"); if ($name === "\x6f\x6c") { $listStart = ltrim(strstr($matches[1], $Block["\144\x61\164\141"]["\155\141\162\x6b\145\x72\x54\x79\x70\x65"], true), "\x30") ?: "\x30"; if ($listStart !== "\x31") { if (isset($CurrentBlock) and $CurrentBlock["\x74\171\160\x65"] === "\120\141\162\141\x67\162\141\x70\150" and !isset($CurrentBlock["\151\x6e\x74\x65\x72\162\165\x70\x74\x65\144"])) { return; } $Block["\145\x6c\x65\x6d\x65\x6e\164"]["\141\164\x74\x72\151\142\x75\x74\x65\x73"] = array("\x73\x74\141\x72\x74" => $listStart); } } $Block["\x6c\x69"] = array("\x6e\x61\x6d\x65" => "\154\x69", "\150\141\156\144\154\x65\x72" => array("\146\165\156\143\x74\151\157\x6e" => "\154\151", "\141\x72\147\165\155\x65\x6e\164" => !empty($matches[3]) ? array($matches[3]) : array(), "\x64\x65\x73\164\151\156\141\x74\x69\x6f\x6e" => "\x65\154\145\x6d\x65\156\164\163")); $Block["\145\x6c\x65\155\145\156\164"]["\145\154\145\x6d\x65\156\164\x73"][] =& $Block["\x6c\151"]; return $Block; } } protected function blockListContinue($Line, array $Block) { if (isset($Block["\x69\156\x74\145\162\x72\x75\x70\164\145\144"]) and empty($Block["\x6c\x69"]["\x68\x61\156\x64\x6c\145\x72"]["\x61\x72\x67\165\155\x65\x6e\x74"])) { return null; } $requiredIndent = $Block["\x69\x6e\144\x65\x6e\164"] + strlen($Block["\x64\x61\164\x61"]["\x6d\141\x72\x6b\145\x72"]); if ($Line["\x69\x6e\x64\x65\156\x74"] < $requiredIndent and ($Block["\144\141\x74\x61"]["\x74\x79\x70\145"] === "\157\154" and preg_match("\x2f\x5e\x5b\60\x2d\71\135\53\53" . $Block["\x64\141\x74\x61"]["\x6d\141\x72\x6b\x65\x72\124\x79\x70\145\122\145\147\145\x78"] . "\50\x3f\72\133\40\135\x2b\53\x28\56\52\51\x7c\x24\51\x2f", $Line["\164\x65\170\164"], $matches) or $Block["\x64\x61\x74\x61"]["\164\x79\160\x65"] === "\x75\x6c" and preg_match("\57\x5e" . $Block["\x64\x61\x74\141"]["\x6d\x61\162\x6b\x65\x72\124\171\x70\x65\x52\x65\x67\145\x78"] . "\50\x3f\x3a\x5b\40\135\x2b\53\50\x2e\52\x29\x7c\44\x29\57", $Line["\x74\x65\x78\164"], $matches))) { if (isset($Block["\x69\x6e\164\x65\162\162\165\160\x74\x65\144"])) { $Block["\154\x69"]["\x68\x61\x6e\144\x6c\145\x72"]["\x61\x72\147\165\x6d\x65\x6e\164"][] = ''; $Block["\x6c\157\x6f\x73\x65"] = true; unset($Block["\x69\x6e\x74\145\x72\162\165\x70\164\145\144"]); } unset($Block["\x6c\x69"]); $text = isset($matches[1]) ? $matches[1] : ''; $Block["\x69\156\144\x65\156\164"] = $Line["\x69\156\x64\x65\156\x74"]; $Block["\154\151"] = array("\156\141\x6d\145" => "\x6c\x69", "\150\141\156\144\x6c\x65\x72" => array("\146\165\x6e\x63\x74\x69\x6f\156" => "\x6c\x69", "\x61\x72\147\x75\155\x65\156\x74" => array($text), "\144\x65\163\164\151\156\x61\164\151\157\x6e" => "\145\x6c\145\x6d\x65\156\x74\x73")); $Block["\x65\x6c\x65\x6d\145\156\x74"]["\x65\x6c\145\x6d\x65\156\x74\x73"][] =& $Block["\x6c\x69"]; return $Block; } elseif ($Line["\151\x6e\x64\145\156\164"] < $requiredIndent and $this->blockList($Line)) { return null; } if ($Line["\x74\145\170\164"][0] === "\x5b" and $this->blockReference($Line)) { return $Block; } if ($Line["\151\156\144\145\156\164"] >= $requiredIndent) { if (isset($Block["\151\x6e\x74\x65\x72\x72\x75\x70\164\145\x64"])) { $Block["\x6c\x69"]["\x68\x61\156\x64\x6c\x65\162"]["\141\x72\147\165\x6d\x65\156\164"][] = ''; $Block["\154\157\157\163\x65"] = true; unset($Block["\151\156\164\145\x72\x72\x75\160\164\x65\x64"]); } $text = substr($Line["\x62\157\144\x79"], $requiredIndent); $Block["\154\151"]["\150\x61\156\x64\x6c\x65\x72"]["\141\162\147\165\x6d\x65\156\164"][] = $text; return $Block; } if (!isset($Block["\x69\x6e\x74\145\x72\x72\x75\x70\164\145\x64"])) { $text = preg_replace("\57\136\x5b\40\135\173\60\x2c" . $requiredIndent . "\175\53\57", '', $Line["\x62\157\144\x79"]); $Block["\154\x69"]["\150\x61\156\x64\x6c\145\162"]["\141\x72\x67\165\155\145\156\x74"][] = $text; return $Block; } } protected function blockListComplete(array $Block) { if (isset($Block["\154\157\157\x73\x65"])) { foreach ($Block["\145\154\x65\x6d\x65\x6e\x74"]["\x65\x6c\x65\x6d\145\x6e\164\x73"] as &$li) { if (end($li["\x68\141\x6e\x64\154\145\162"]["\141\x72\x67\165\x6d\x65\156\x74"]) !== '') { $li["\150\141\156\144\154\x65\162"]["\141\x72\x67\x75\x6d\x65\x6e\x74"][] = ''; } } } return $Block; } protected function blockQuote($Line) { if (preg_match("\57\x5e\76\x5b\x20\x5d\77\x2b\x28\x2e\x2a\x2b\51\57", $Line["\164\x65\170\x74"], $matches)) { $Block = array("\x65\x6c\145\x6d\x65\156\164" => array("\156\x61\155\x65" => "\142\x6c\157\143\x6b\161\165\157\164\x65", "\150\x61\156\x64\154\145\162" => array("\146\165\156\143\x74\151\x6f\x6e" => "\x6c\151\156\145\163\x45\154\145\x6d\145\156\x74\163", "\x61\162\147\165\155\145\x6e\164" => (array) $matches[1], "\144\145\163\x74\151\156\x61\164\151\157\156" => "\145\154\145\x6d\145\x6e\x74\x73"))); return $Block; } } protected function blockQuoteContinue($Line, array $Block) { if (isset($Block["\x69\x6e\x74\x65\x72\x72\x75\160\164\145\144"])) { return; } if ($Line["\164\x65\170\164"][0] === "\x3e" and preg_match("\57\136\x3e\133\x20\135\x3f\53\50\56\52\53\51\57", $Line["\x74\x65\170\164"], $matches)) { $Block["\145\154\145\155\x65\156\x74"]["\x68\141\x6e\x64\154\145\162"]["\x61\162\x67\x75\x6d\x65\x6e\x74"][] = $matches[1]; return $Block; } if (!isset($Block["\x69\x6e\x74\145\162\x72\165\x70\164\145\144"])) { $Block["\145\154\145\x6d\145\x6e\x74"]["\x68\x61\x6e\x64\154\145\162"]["\x61\162\x67\x75\x6d\145\x6e\x74"][] = $Line["\x74\x65\x78\164"]; return $Block; } } protected function blockRule($Line) { $marker = $Line["\x74\145\x78\x74"][0]; if (substr_count($Line["\x74\x65\x78\164"], $marker) >= 3 and chop($Line["\164\145\x78\164"], "\40{$marker}") === '') { $Block = array("\x65\x6c\145\x6d\145\x6e\x74" => array("\156\x61\155\x65" => "\150\162")); return $Block; } } protected function blockSetextHeader($Line, array $Block = null) { if (!isset($Block) or $Block["\x74\x79\x70\145"] !== "\120\x61\162\x61\147\162\x61\160\x68" or isset($Block["\151\156\164\x65\x72\x72\165\x70\164\145\x64"])) { return; } if ($Line["\x69\x6e\144\145\156\x74"] < 4 and chop(chop($Line["\x74\x65\170\x74"], "\40"), $Line["\164\x65\x78\x74"][0]) === '') { $Block["\145\x6c\x65\x6d\145\x6e\164"]["\156\141\155\x65"] = $Line["\164\145\170\x74"][0] === "\x3d" ? "\x68\61" : "\150\62"; return $Block; } } protected function blockMarkup($Line) { if ($this->markupEscaped or $this->safeMode) { return; } if (preg_match("\57\x5e\x3c\x5b\134\x2f\x5d\x3f\x2b\50\x5c\167\x2a\x29\x28\x3f\72\133\x20\135\x2a\x2b" . $this->regexHtmlAttribute . "\x29\52\x2b\x5b\40\135\52\x2b\x28\134\x2f\x29\77\x3e\57", $Line["\x74\x65\170\x74"], $matches)) { $element = strtolower($matches[1]); if (in_array($element, $this->textLevelElements)) { return; } $Block = array("\x6e\141\155\x65" => $matches[1], "\145\x6c\x65\x6d\x65\x6e\x74" => array("\162\141\x77\110\164\x6d\154" => $Line["\x74\145\170\x74"], "\x61\165\164\157\x62\162\x65\x61\153" => true)); return $Block; } } protected function blockMarkupContinue($Line, array $Block) { if (isset($Block["\143\154\157\x73\x65\x64"]) or isset($Block["\151\156\164\x65\162\162\x75\160\x74\x65\x64"])) { return; } $Block["\145\x6c\145\155\x65\x6e\164"]["\x72\x61\x77\x48\164\x6d\x6c"] .= "\xa" . $Line["\x62\157\x64\x79"]; return $Block; } protected function blockReference($Line) { if (strpos($Line["\164\145\x78\x74"], "\x5d") !== false and preg_match("\x2f\x5e\134\x5b\x28\56\x2b\x3f\x29\x5c\x5d\x3a\x5b\40\x5d\52\53\x3c\77\50\x5c\123\53\77\x29\76\77\50\x3f\72\x5b\x20\135\x2b\133\x22\47\50\135\x28\56\53\51\133\42\x27\x29\x5d\x29\77\x5b\x20\x5d\52\53\44\x2f", $Line["\x74\x65\x78\x74"], $matches)) { $id = strtolower($matches[1]); $Data = array("\x75\x72\154" => $matches[2], "\x74\151\x74\x6c\x65" => isset($matches[3]) ? $matches[3] : null); $this->DefinitionData["\122\145\x66\x65\162\x65\x6e\x63\145"][$id] = $Data; $Block = array("\145\154\145\x6d\x65\156\164" => array()); return $Block; } } protected function blockTable($Line, array $Block = null) { if (!isset($Block) or $Block["\164\171\160\145"] !== "\x50\141\x72\141\147\x72\141\160\x68" or isset($Block["\151\156\x74\145\162\162\x75\160\164\x65\144"])) { return; } if (strpos($Block["\145\154\145\x6d\145\156\164"]["\x68\141\x6e\x64\154\x65\162"]["\141\162\x67\165\155\x65\156\x74"], "\x7c") === false and strpos($Line["\x74\x65\x78\x74"], "\x7c") === false and strpos($Line["\164\145\x78\164"], "\72") === false or strpos($Block["\145\154\x65\155\x65\156\164"]["\x68\141\x6e\x64\x6c\145\x72"]["\141\x72\x67\165\155\x65\156\x74"], "\xa") !== false) { return; } if (chop($Line["\x74\145\170\x74"], "\40\55\x3a\174") !== '') { return; } $alignments = array(); $divider = $Line["\164\x65\x78\x74"]; $divider = trim($divider); $divider = trim($divider, "\x7c"); $dividerCells = explode("\x7c", $divider); foreach ($dividerCells as $dividerCell) { $dividerCell = trim($dividerCell); if ($dividerCell === '') { return; } $alignment = null; if ($dividerCell[0] === "\72") { $alignment = "\x6c\145\146\x74"; } if (substr($dividerCell, -1) === "\x3a") { $alignment = $alignment === "\x6c\145\x66\x74" ? "\143\145\x6e\164\145\x72" : "\x72\x69\147\150\x74"; } $alignments[] = $alignment; } $HeaderElements = array(); $header = $Block["\145\154\145\155\x65\156\164"]["\150\x61\156\144\x6c\145\162"]["\141\162\x67\165\x6d\x65\156\164"]; $header = trim($header); $header = trim($header, "\174"); $headerCells = explode("\174", $header); if (count($headerCells) !== count($alignments)) { return; } foreach ($headerCells as $index => $headerCell) { $headerCell = trim($headerCell); $HeaderElement = array("\156\141\x6d\145" => "\x74\150", "\x68\141\x6e\144\x6c\145\162" => array("\146\165\x6e\x63\164\151\x6f\x6e" => "\154\x69\x6e\145\x45\154\145\x6d\145\156\x74\x73", "\141\162\x67\165\155\145\x6e\164" => $headerCell, "\x64\145\x73\x74\x69\x6e\141\164\151\157\x6e" => "\145\x6c\145\x6d\x65\156\164\163")); if (isset($alignments[$index])) { $alignment = $alignments[$index]; $HeaderElement["\141\164\x74\162\x69\x62\165\x74\x65\163"] = array("\163\164\x79\154\145" => "\x74\145\x78\164\x2d\x61\x6c\151\147\156\x3a\x20{$alignment}\73"); } $HeaderElements[] = $HeaderElement; } $Block = array("\141\x6c\x69\x67\x6e\x6d\145\156\164\x73" => $alignments, "\151\144\x65\156\164\151\x66\151\x65\x64" => true, "\145\x6c\145\x6d\x65\x6e\x74" => array("\156\141\x6d\x65" => "\x74\x61\142\154\145", "\x65\154\145\x6d\145\156\164\163" => array())); $Block["\x65\x6c\145\x6d\x65\156\x74"]["\x65\x6c\145\x6d\x65\156\x74\x73"][] = array("\156\141\155\145" => "\164\150\x65\141\x64"); $Block["\145\x6c\x65\155\145\x6e\x74"]["\x65\x6c\x65\x6d\145\156\x74\x73"][] = array("\x6e\141\x6d\145" => "\x74\142\x6f\144\171", "\x65\154\x65\x6d\x65\156\x74\x73" => array()); $Block["\145\154\x65\155\x65\x6e\164"]["\x65\154\x65\155\145\156\164\x73"][0]["\145\154\x65\155\145\156\164\163"][] = array("\x6e\x61\x6d\145" => "\164\x72", "\145\154\x65\x6d\x65\156\x74\163" => $HeaderElements); return $Block; } protected function blockTableContinue($Line, array $Block) { if (isset($Block["\x69\x6e\x74\x65\162\162\165\160\x74\145\x64"])) { return; } if (count($Block["\x61\x6c\151\147\x6e\155\x65\x6e\x74\163"]) === 1 or $Line["\x74\x65\x78\164"][0] === "\x7c" or strpos($Line["\x74\145\170\164"], "\174")) { $Elements = array(); $row = $Line["\164\145\x78\x74"]; $row = trim($row); $row = trim($row, "\x7c"); preg_match_all("\x2f\x28\77\x3a\50\x5c\x5c\133\174\135\51\x7c\133\x5e\174\x60\135\174\140\x5b\x5e\x60\135\x2b\53\x60\x7c\140\51\x2b\x2b\57", $row, $matches); $cells = array_slice($matches[0], 0, count($Block["\141\x6c\x69\x67\156\155\x65\x6e\x74\163"])); foreach ($cells as $index => $cell) { $cell = trim($cell); $Element = array("\x6e\141\x6d\x65" => "\164\144", "\150\x61\x6e\144\x6c\x65\162" => array("\x66\165\156\x63\x74\x69\x6f\156" => "\154\x69\156\145\105\154\x65\155\x65\x6e\x74\x73", "\141\162\x67\x75\155\145\156\164" => $cell, "\x64\145\x73\x74\151\156\x61\x74\151\157\x6e" => "\145\x6c\x65\155\145\x6e\164\x73")); if (isset($Block["\141\154\x69\x67\x6e\x6d\145\x6e\x74\163"][$index])) { $Element["\x61\164\164\x72\151\x62\x75\164\x65\x73"] = array("\163\164\171\x6c\145" => "\164\145\170\x74\55\x61\x6c\151\147\156\x3a\40" . $Block["\x61\x6c\151\147\156\155\145\x6e\164\x73"][$index] . "\x3b"); } $Elements[] = $Element; } $Element = array("\x6e\x61\x6d\x65" => "\x74\162", "\145\154\x65\155\x65\x6e\x74\163" => $Elements); $Block["\x65\154\x65\155\x65\156\x74"]["\x65\154\145\x6d\x65\x6e\164\163"][1]["\x65\154\x65\155\x65\x6e\x74\x73"][] = $Element; return $Block; } } protected function paragraph($Line) { return array("\x74\x79\x70\x65" => "\x50\x61\x72\x61\147\x72\141\160\x68", "\x65\x6c\x65\155\145\x6e\164" => array("\x6e\x61\155\145" => "\160", "\x68\x61\x6e\144\x6c\x65\162" => array("\146\165\x6e\143\164\151\157\156" => "\x6c\151\156\x65\x45\x6c\x65\x6d\x65\x6e\164\x73", "\141\162\x67\x75\155\x65\x6e\164" => $Line["\x74\x65\x78\x74"], "\x64\x65\163\x74\151\156\141\x74\151\157\x6e" => "\145\x6c\145\x6d\x65\x6e\x74\x73"))); } protected function paragraphContinue($Line, array $Block) { if (isset($Block["\x69\x6e\x74\145\162\x72\x75\160\x74\x65\144"])) { return; } $Block["\145\x6c\x65\155\x65\x6e\164"]["\150\141\x6e\144\154\145\162"]["\141\x72\x67\165\x6d\145\x6e\x74"] .= "\xa" . $Line["\164\145\x78\164"]; return $Block; } protected $InlineTypes = array("\41" => array("\111\x6d\x61\147\145"), "\46" => array("\x53\160\x65\x63\x69\141\154\103\150\x61\x72\141\x63\x74\145\x72"), "\x2a" => array("\x45\155\160\x68\141\x73\x69\x73"), "\72" => array("\x55\x72\154"), "\74" => array("\125\x72\154\124\141\x67", "\105\x6d\141\151\x6c\x54\141\x67", "\x4d\141\x72\x6b\165\160"), "\133" => array("\x4c\151\x6e\153"), "\x5f" => array("\x45\155\160\x68\141\x73\151\x73"), "\x60" => array("\x43\157\x64\x65"), "\x7e" => array("\x53\x74\162\151\153\145\x74\150\x72\157\x75\147\150"), "\x5c" => array("\x45\163\143\141\160\145\123\x65\161\x75\145\x6e\x63\145")); protected $inlineMarkerList = "\x21\52\x5f\46\x5b\x3a\x3c\140\x7e\134"; public function line($text, $nonNestables = array()) { return $this->elements($this->lineElements($text, $nonNestables)); } protected function lineElements($text, $nonNestables = array()) { $text = str_replace(array("\xd\12", "\xd"), "\12", $text); $Elements = array(); $nonNestables = empty($nonNestables) ? array() : array_combine($nonNestables, $nonNestables); while ($excerpt = strpbrk($text, $this->inlineMarkerList)) { $marker = $excerpt[0]; $markerPosition = strlen($text) - strlen($excerpt); $Excerpt = array("\x74\145\x78\x74" => $excerpt, "\143\157\x6e\x74\x65\170\x74" => $text); foreach ($this->InlineTypes[$marker] as $inlineType) { if (isset($nonNestables[$inlineType])) { continue; } $Inline = $this->{"\151\x6e\x6c\151\156\x65{$inlineType}"}($Excerpt); if (!isset($Inline)) { continue; } if (isset($Inline["\x70\157\x73\x69\x74\151\157\x6e"]) and $Inline["\x70\x6f\x73\151\x74\x69\x6f\x6e"] > $markerPosition) { continue; } if (!isset($Inline["\x70\x6f\x73\151\x74\151\157\156"])) { $Inline["\x70\x6f\163\151\x74\x69\157\x6e"] = $markerPosition; } $Inline["\x65\x6c\x65\155\145\156\164"]["\156\157\156\x4e\x65\163\164\141\x62\154\145\x73"] = isset($Inline["\x65\154\x65\x6d\145\x6e\x74"]["\156\157\156\116\x65\x73\164\141\x62\x6c\145\163"]) ? array_merge($Inline["\145\154\x65\x6d\x65\156\x74"]["\x6e\x6f\156\x4e\x65\163\x74\x61\x62\154\x65\x73"], $nonNestables) : $nonNestables; $unmarkedText = substr($text, 0, $Inline["\x70\157\163\x69\x74\x69\x6f\x6e"]); $InlineText = $this->inlineText($unmarkedText); $Elements[] = $InlineText["\x65\x6c\x65\x6d\x65\156\x74"]; $Elements[] = $this->extractElement($Inline); $text = substr($text, $Inline["\160\157\163\x69\x74\x69\x6f\156"] + $Inline["\145\170\164\x65\156\x74"]); continue 2; } $unmarkedText = substr($text, 0, $markerPosition + 1); $InlineText = $this->inlineText($unmarkedText); $Elements[] = $InlineText["\145\154\x65\155\x65\156\164"]; $text = substr($text, $markerPosition + 1); } $InlineText = $this->inlineText($text); $Elements[] = $InlineText["\145\x6c\145\x6d\x65\x6e\164"]; foreach ($Elements as &$Element) { if (!isset($Element["\141\x75\164\x6f\142\x72\145\x61\x6b"])) { $Element["\141\x75\164\x6f\142\x72\145\x61\153"] = false; } } return $Elements; } protected function inlineText($text) { $Inline = array("\145\170\164\145\156\164" => strlen($text), "\145\154\145\x6d\145\156\164" => array()); $Inline["\x65\154\x65\155\x65\x6e\164"]["\x65\x6c\x65\x6d\145\156\x74\x73"] = self::pregReplaceElements($this->breaksEnabled ? "\x2f\133\40\x5d\52\x2b\134\156\x2f" : "\x2f\50\x3f\72\133\x20\x5d\52\53\x5c\134\x7c\133\x20\135\173\62\x2c\x7d\x2b\51\x5c\x6e\57", array(array("\156\141\155\145" => "\142\162"), array("\164\145\170\164" => "\xa")), $text); return $Inline; } protected function inlineCode($Excerpt) { $marker = $Excerpt["\x74\145\x78\164"][0]; if (preg_match("\x2f\x5e\50\x5b" . $marker . "\x5d\53\x2b\51\x5b\x20\135\x2a\53\x28\56\53\x3f\51\x5b\40\x5d\52\53\50\x3f\x3c\41\x5b" . $marker . "\x5d\x29\134\61\50\77\x21" . $marker . "\51\x2f\163", $Excerpt["\x74\145\170\x74"], $matches)) { $text = $matches[2]; $text = preg_replace("\57\x5b\40\x5d\52\x2b\x5c\156\x2f", "\40", $text); return array("\x65\x78\164\145\x6e\x74" => strlen($matches[0]), "\x65\154\145\x6d\x65\156\x74" => array("\156\141\x6d\x65" => "\143\157\x64\x65", "\x74\x65\x78\164" => $text)); } } protected function inlineEmailTag($Excerpt) { $hostnameLabel = "\x5b\x61\x2d\172\x41\55\132\x30\x2d\x39\135\x28\77\72\133\141\x2d\172\x41\x2d\x5a\x30\x2d\71\55\135\x7b\60\x2c\66\61\x7d\x5b\141\x2d\x7a\x41\55\x5a\60\x2d\71\x5d\51\77"; $commonMarkEmail = "\133\141\55\x7a\101\55\x5a\x30\55\x39\x2e\x21\43\44\45\46\x27\52\53\x5c\x2f\x3d\x3f\136\x5f\140\x7b\x7c\175\x7e\55\x5d\x2b\x2b\x40" . $hostnameLabel . "\x28\77\x3a\134\x2e" . $hostnameLabel . "\51\x2a"; if (strpos($Excerpt["\164\145\170\164"], "\76") !== false and preg_match("\x2f\136\74\50\x28\155\141\x69\x6c\x74\157\x3a\x29\77{$commonMarkEmail}\51\x3e\x2f\151", $Excerpt["\164\x65\x78\164"], $matches)) { $url = $matches[1]; if (!isset($matches[2])) { $url = "\x6d\141\x69\154\x74\x6f\72{$url}"; } return array("\x65\x78\x74\x65\156\164" => strlen($matches[0]), "\145\x6c\145\155\145\x6e\164" => array("\156\141\155\x65" => "\141", "\164\x65\x78\164" => $matches[1], "\141\x74\x74\x72\x69\142\x75\164\145\x73" => array("\150\162\x65\146" => $url))); } } protected function inlineEmphasis($Excerpt) { if (!isset($Excerpt["\x74\x65\x78\164"][1])) { return; } $marker = $Excerpt["\164\145\x78\164"][0]; if ($Excerpt["\x74\x65\x78\164"][1] === $marker and preg_match($this->StrongRegex[$marker], $Excerpt["\164\x65\x78\x74"], $matches)) { $emphasis = "\163\164\x72\x6f\156\x67"; } elseif (preg_match($this->EmRegex[$marker], $Excerpt["\x74\x65\170\164"], $matches)) { $emphasis = "\145\155"; } else { return; } return array("\145\170\164\x65\156\164" => strlen($matches[0]), "\145\154\x65\x6d\145\x6e\x74" => array("\156\141\x6d\145" => $emphasis, "\150\141\156\x64\154\145\162" => array("\146\x75\156\143\164\x69\157\156" => "\154\x69\x6e\x65\x45\x6c\x65\155\145\x6e\x74\163", "\x61\162\147\x75\x6d\x65\156\164" => $matches[1], "\x64\145\163\164\151\x6e\141\x74\x69\157\x6e" => "\x65\x6c\145\x6d\145\x6e\x74\x73"))); } protected function inlineEscapeSequence($Excerpt) { if (isset($Excerpt["\164\145\170\164"][1]) and in_array($Excerpt["\164\x65\x78\x74"][1], $this->specialCharacters)) { return array("\x65\154\x65\155\145\156\x74" => array("\162\141\x77\x48\164\155\x6c" => $Excerpt["\x74\145\170\x74"][1]), "\x65\170\x74\x65\x6e\x74" => 2); } } protected function inlineImage($Excerpt) { if (!isset($Excerpt["\164\145\170\x74"][1]) or $Excerpt["\164\145\x78\164"][1] !== "\133") { return; } $Excerpt["\164\x65\x78\164"] = substr($Excerpt["\164\145\x78\164"], 1); $Link = $this->inlineLink($Excerpt); if ($Link === null) { return; } $Inline = array("\x65\170\x74\145\156\x74" => $Link["\x65\170\164\x65\x6e\x74"] + 1, "\x65\x6c\145\155\x65\156\x74" => array("\x6e\x61\x6d\x65" => "\151\155\147", "\x61\x74\x74\x72\x69\142\165\x74\x65\163" => array("\x73\162\143" => $Link["\145\x6c\145\x6d\x65\156\x74"]["\141\164\164\162\x69\x62\165\164\x65\x73"]["\x68\162\x65\x66"], "\141\154\164" => $Link["\x65\154\145\x6d\145\x6e\164"]["\150\x61\156\x64\154\145\162"]["\x61\x72\147\165\155\x65\156\164"]), "\141\165\164\157\x62\x72\x65\x61\153" => true)); $Inline["\145\x6c\x65\155\x65\x6e\x74"]["\x61\164\164\162\151\142\165\164\x65\x73"] += $Link["\x65\x6c\145\155\x65\156\164"]["\141\x74\164\162\x69\142\165\x74\x65\163"]; unset($Inline["\145\154\145\x6d\x65\156\164"]["\141\164\164\x72\151\142\x75\x74\x65\163"]["\150\162\145\x66"]); return $Inline; } protected function inlineLink($Excerpt) { $Element = array("\x6e\141\x6d\145" => "\141", "\x68\141\156\x64\x6c\x65\162" => array("\x66\165\156\143\164\151\157\156" => "\x6c\x69\156\145\105\154\145\155\145\156\x74\163", "\x61\x72\x67\165\x6d\x65\x6e\164" => null, "\x64\x65\x73\164\151\x6e\141\164\151\x6f\x6e" => "\145\154\145\x6d\x65\156\x74\163"), "\156\157\156\x4e\x65\163\x74\x61\x62\154\x65\163" => array("\125\x72\x6c", "\x4c\151\156\153"), "\x61\164\x74\162\x69\x62\x75\x74\x65\163" => array("\150\x72\x65\146" => null, "\x74\x69\164\154\x65" => null)); $extent = 0; $remainder = $Excerpt["\164\145\170\x74"]; if (preg_match("\57\x5c\133\50\x28\x3f\x3a\x5b\136\x5d\x5b\x5d\53\x2b\174\x28\77\122\51\x29\x2a\x2b\51\134\135\57", $remainder, $matches)) { $Element["\150\x61\x6e\144\154\x65\162"]["\141\x72\x67\x75\x6d\145\x6e\164"] = $matches[1]; $extent += strlen($matches[0]); $remainder = substr($remainder, $extent); } else { return; } if (preg_match("\57\x5e\x5b\x28\135\134\163\x2a\x2b\50\x28\x3f\x3a\x5b\x5e\40\50\x29\135\53\x2b\174\x5b\50\135\x5b\x5e\40\51\x5d\53\133\51\135\x29\53\53\x29\50\x3f\72\x5b\x20\135\53\x28\42\x5b\136\42\x5d\x2a\53\x22\x7c\47\133\x5e\x27\x5d\52\x2b\47\51\x29\77\134\163\x2a\x2b\x5b\51\x5d\x2f", $remainder, $matches)) { $Element["\x61\164\x74\162\x69\142\x75\x74\x65\x73"]["\150\162\x65\146"] = $matches[1]; if (isset($matches[2])) { $Element["\141\x74\x74\x72\151\142\x75\164\x65\x73"]["\164\151\x74\154\145"] = substr($matches[2], 1, -1); } $extent += strlen($matches[0]); } else { if (preg_match("\57\x5e\134\163\x2a\x5c\133\50\56\x2a\77\x29\x5c\x5d\57", $remainder, $matches)) { $definition = strlen($matches[1]) ? $matches[1] : $Element["\x68\141\x6e\x64\154\x65\x72"]["\x61\x72\147\165\x6d\x65\156\164"]; $definition = strtolower($definition); $extent += strlen($matches[0]); } else { $definition = strtolower($Element["\x68\141\156\x64\x6c\x65\x72"]["\x61\162\x67\x75\155\145\156\164"]); } if (!isset($this->DefinitionData["\122\x65\146\145\x72\145\156\x63\145"][$definition])) { return; } $Definition = $this->DefinitionData["\122\x65\146\145\x72\x65\x6e\x63\x65"][$definition]; $Element["\141\x74\x74\162\x69\142\165\164\x65\163"]["\x68\x72\x65\146"] = $Definition["\165\162\x6c"]; $Element["\x61\x74\164\162\x69\142\x75\164\x65\163"]["\164\151\164\x6c\145"] = $Definition["\x74\151\164\x6c\x65"]; } return array("\145\x78\164\x65\156\x74" => $extent, "\x65\x6c\145\155\145\x6e\x74" => $Element); } protected function inlineMarkup($Excerpt) { if ($this->markupEscaped or $this->safeMode or strpos($Excerpt["\x74\x65\x78\164"], "\76") === false) { return; } if ($Excerpt["\164\145\170\164"][1] === "\57" and preg_match("\57\x5e\74\x5c\57\134\167\x5b\x5c\x77\55\135\52\x2b\x5b\40\135\52\53\76\57\x73", $Excerpt["\x74\145\170\x74"], $matches)) { return array("\x65\x6c\145\x6d\145\156\x74" => array("\162\141\167\110\164\x6d\154" => $matches[0]), "\145\x78\164\x65\156\x74" => strlen($matches[0])); } if ($Excerpt["\x74\x65\170\164"][1] === "\41" and preg_match("\x2f\x5e\74\x21\x2d\55\x2d\77\x5b\x5e\x3e\x2d\135\50\x3f\x3a\55\x3f\x2b\x5b\x5e\55\x5d\51\52\x2d\55\76\x2f\163", $Excerpt["\164\145\170\164"], $matches)) { return array("\145\x6c\145\155\145\x6e\x74" => array("\162\x61\x77\x48\164\155\154" => $matches[0]), "\145\170\164\x65\156\164" => strlen($matches[0])); } if ($Excerpt["\x74\145\170\164"][1] !== "\x20" and preg_match("\57\136\74\134\x77\133\x5c\x77\x2d\x5d\x2a\x2b\x28\x3f\x3a\133\x20\x5d\x2a\x2b" . $this->regexHtmlAttribute . "\x29\x2a\53\x5b\40\135\52\53\134\57\77\76\57\x73", $Excerpt["\x74\x65\x78\164"], $matches)) { return array("\145\x6c\145\x6d\x65\x6e\x74" => array("\162\x61\x77\110\x74\155\x6c" => $matches[0]), "\145\170\x74\x65\156\x74" => strlen($matches[0])); } } protected function inlineSpecialCharacter($Excerpt) { if (substr($Excerpt["\164\145\x78\164"], 1, 1) !== "\40" and strpos($Excerpt["\164\x65\x78\164"], "\73") !== false and preg_match("\57\x5e\x26\50\x23\x3f\53\133\x30\x2d\x39\141\55\x7a\101\55\x5a\x5d\x2b\x2b\51\73\x2f", $Excerpt["\164\x65\170\164"], $matches)) { return array("\145\154\145\155\x65\156\x74" => array("\162\141\167\x48\164\x6d\x6c" => "\46" . $matches[1] . "\73"), "\x65\x78\164\145\x6e\164" => strlen($matches[0])); } return; } protected function inlineStrikethrough($Excerpt) { if (!isset($Excerpt["\164\x65\170\164"][1])) { return; } if ($Excerpt["\164\145\170\x74"][1] === "\176" and preg_match("\57\x5e\176\176\x28\x3f\x3d\134\x53\x29\x28\56\53\x3f\51\50\77\74\75\x5c\123\x29\x7e\x7e\57", $Excerpt["\x74\x65\170\x74"], $matches)) { return array("\x65\x78\x74\145\156\164" => strlen($matches[0]), "\145\x6c\x65\155\x65\156\x74" => array("\156\141\x6d\145" => "\x64\x65\154", "\x68\141\156\144\154\145\x72" => array("\146\165\x6e\143\x74\151\x6f\156" => "\154\151\x6e\x65\x45\154\x65\x6d\x65\156\x74\x73", "\141\162\x67\x75\x6d\145\x6e\x74" => $matches[1], "\x64\145\163\x74\x69\x6e\x61\164\151\157\x6e" => "\145\154\x65\x6d\x65\x6e\164\163"))); } } protected function inlineUrl($Excerpt) { if ($this->urlsLinked !== true or !isset($Excerpt["\x74\x65\170\x74"][2]) or $Excerpt["\164\145\170\164"][2] !== "\x2f") { return; } if (strpos($Excerpt["\x63\x6f\156\164\145\170\164"], "\x68\164\164\x70") !== false and preg_match("\57\134\142\150\164\x74\x70\163\x3f\53\x3a\133\134\x2f\x5d\173\62\x7d\133\136\x5c\x73\x3c\135\53\134\142\x5c\57\52\53\57\165\151", $Excerpt["\143\x6f\156\164\x65\x78\x74"], $matches, PREG_OFFSET_CAPTURE)) { $url = $matches[0][0]; $Inline = array("\145\x78\164\145\x6e\x74" => strlen($matches[0][0]), "\x70\x6f\163\151\x74\151\157\156" => $matches[0][1], "\145\154\145\155\145\156\164" => array("\x6e\x61\x6d\x65" => "\141", "\x74\x65\x78\164" => $url, "\x61\164\x74\x72\151\x62\x75\x74\x65\x73" => array("\x68\162\x65\146" => $url))); return $Inline; } } protected function inlineUrlTag($Excerpt) { if (strpos($Excerpt["\x74\x65\170\164"], "\x3e") !== false and preg_match("\57\136\74\x28\134\x77\x2b\x2b\72\134\x2f\x7b\x32\x7d\133\x5e\40\x3e\x5d\x2b\x2b\51\76\x2f\x69", $Excerpt["\x74\145\170\x74"], $matches)) { $url = $matches[1]; return array("\x65\x78\x74\x65\156\164" => strlen($matches[0]), "\x65\154\x65\x6d\x65\x6e\164" => array("\156\x61\x6d\145" => "\x61", "\x74\x65\x78\164" => $url, "\x61\x74\164\x72\x69\x62\165\164\145\x73" => array("\150\x72\145\146" => $url))); } } protected function unmarkedText($text) { $Inline = $this->inlineText($text); return $this->element($Inline["\145\x6c\145\x6d\x65\156\x74"]); } protected function handle(array $Element) { if (isset($Element["\x68\x61\156\144\154\145\162"])) { if (!isset($Element["\156\157\x6e\x4e\x65\x73\164\x61\x62\154\x65\x73"])) { $Element["\156\157\x6e\x4e\x65\x73\x74\x61\142\154\145\163"] = array(); } if (is_string($Element["\150\x61\156\x64\154\x65\x72"])) { $function = $Element["\x68\141\156\144\154\x65\x72"]; $argument = $Element["\164\145\170\164"]; unset($Element["\164\145\x78\x74"]); $destination = "\x72\141\x77\110\164\155\154"; } else { $function = $Element["\x68\x61\156\144\x6c\145\x72"]["\146\165\156\143\164\151\157\156"]; $argument = $Element["\150\x61\156\x64\154\x65\162"]["\141\162\x67\x75\155\x65\x6e\164"]; $destination = $Element["\150\x61\x6e\x64\x6c\x65\x72"]["\144\x65\x73\164\x69\x6e\x61\164\151\157\x6e"]; } $Element[$destination] = $this->{$function}($argument, $Element["\156\x6f\x6e\x4e\145\x73\164\141\142\154\145\163"]); if ($destination === "\x68\x61\156\144\x6c\x65\162") { $Element = $this->handle($Element); } unset($Element["\x68\141\x6e\144\154\145\162"]); } return $Element; } protected function handleElementRecursive(array $Element) { return $this->elementApplyRecursive(array($this, "\x68\141\156\x64\154\145"), $Element); } protected function handleElementsRecursive(array $Elements) { return $this->elementsApplyRecursive(array($this, "\x68\141\x6e\144\154\x65"), $Elements); } protected function elementApplyRecursive($closure, array $Element) { $Element = call_user_func($closure, $Element); if (isset($Element["\145\154\x65\x6d\x65\x6e\x74\x73"])) { $Element["\x65\154\x65\x6d\145\156\164\163"] = $this->elementsApplyRecursive($closure, $Element["\x65\x6c\x65\155\145\156\x74\163"]); } elseif (isset($Element["\x65\154\x65\x6d\x65\156\164"])) { $Element["\x65\154\145\x6d\x65\156\x74"] = $this->elementApplyRecursive($closure, $Element["\145\154\145\x6d\145\156\x74"]); } return $Element; } protected function elementApplyRecursiveDepthFirst($closure, array $Element) { if (isset($Element["\x65\x6c\145\155\145\156\x74\163"])) { $Element["\x65\154\145\x6d\145\156\x74\163"] = $this->elementsApplyRecursiveDepthFirst($closure, $Element["\x65\x6c\145\155\145\x6e\164\x73"]); } elseif (isset($Element["\145\154\x65\x6d\145\x6e\x74"])) { $Element["\x65\x6c\145\x6d\145\x6e\164"] = $this->elementsApplyRecursiveDepthFirst($closure, $Element["\145\154\x65\155\x65\156\164"]); } $Element = call_user_func($closure, $Element); return $Element; } protected function elementsApplyRecursive($closure, array $Elements) { foreach ($Elements as &$Element) { $Element = $this->elementApplyRecursive($closure, $Element); } return $Elements; } protected function elementsApplyRecursiveDepthFirst($closure, array $Elements) { foreach ($Elements as &$Element) { $Element = $this->elementApplyRecursiveDepthFirst($closure, $Element); } return $Elements; } protected function element(array $Element) { if ($this->safeMode) { $Element = $this->sanitiseElement($Element); } $Element = $this->handle($Element); $hasName = isset($Element["\156\x61\155\145"]); $markup = ''; if ($hasName) { $markup .= "\x3c" . $Element["\x6e\x61\155\145"]; if (isset($Element["\141\x74\164\x72\x69\x62\x75\164\145\163"])) { foreach ($Element["\x61\x74\164\162\151\142\x75\164\145\x73"] as $name => $value) { if ($value === null) { continue; } $markup .= "\x20{$name}\x3d\42" . self::escape($value) . "\x22"; } } } $permitRawHtml = false; if (isset($Element["\x74\x65\x78\164"])) { $text = $Element["\x74\145\170\164"]; } elseif (isset($Element["\162\141\x77\x48\164\155\x6c"])) { $text = $Element["\x72\141\167\x48\164\x6d\154"]; $allowRawHtmlInSafeMode = isset($Element["\x61\x6c\x6c\157\167\x52\x61\x77\110\164\x6d\x6c\x49\156\123\x61\x66\145\x4d\x6f\x64\145"]) && $Element["\x61\x6c\154\157\167\x52\x61\167\x48\164\155\x6c\x49\156\123\141\x66\x65\x4d\157\144\x65"]; $permitRawHtml = !$this->safeMode || $allowRawHtmlInSafeMode; } $hasContent = isset($text) || isset($Element["\x65\x6c\x65\155\x65\156\x74"]) || isset($Element["\x65\x6c\145\155\x65\156\x74\x73"]); if ($hasContent) { $markup .= $hasName ? "\76" : ''; if (isset($Element["\x65\x6c\x65\155\x65\x6e\164\x73"])) { $markup .= $this->elements($Element["\145\154\x65\x6d\x65\x6e\x74\163"]); } elseif (isset($Element["\145\x6c\145\155\145\156\x74"])) { $markup .= $this->element($Element["\x65\x6c\145\155\x65\156\164"]); } else { if (!$permitRawHtml) { $markup .= self::escape($text, true); } else { $markup .= $text; } } $markup .= $hasName ? "\x3c\57" . $Element["\x6e\141\x6d\x65"] . "\76" : ''; } elseif ($hasName) { $markup .= "\40\x2f\76"; } return $markup; } protected function elements(array $Elements) { $markup = ''; $autoBreak = true; foreach ($Elements as $Element) { if (empty($Element)) { continue; } $autoBreakNext = isset($Element["\x61\x75\164\157\142\162\145\141\x6b"]) ? $Element["\x61\165\164\157\x62\x72\x65\x61\153"] : isset($Element["\156\141\x6d\x65"]); $autoBreak = !$autoBreak ? $autoBreak : $autoBreakNext; $markup .= ($autoBreak ? "\xa" : '') . $this->element($Element); $autoBreak = $autoBreakNext; } $markup .= $autoBreak ? "\12" : ''; return $markup; } protected function li($lines) { $Elements = $this->linesElements($lines); if (!in_array('', $lines) and isset($Elements[0]) and isset($Elements[0]["\x6e\141\155\x65"]) and $Elements[0]["\156\141\155\145"] === "\160") { unset($Elements[0]["\x6e\141\155\145"]); } return $Elements; } protected static function pregReplaceElements($regexp, $Elements, $text) { $newElements = array(); while (preg_match($regexp, $text, $matches, PREG_OFFSET_CAPTURE)) { $offset = $matches[0][1]; $before = substr($text, 0, $offset); $after = substr($text, $offset + strlen($matches[0][0])); $newElements[] = array("\164\145\170\x74" => $before); foreach ($Elements as $Element) { $newElements[] = $Element; } $text = $after; } $newElements[] = array("\164\145\x78\164" => $text); return $newElements; } function parse($text) { $markup = $this->text($text); return $markup; } protected function sanitiseElement(array $Element) { static $goodAttribute = "\57\136\133\x61\x2d\172\x41\55\132\60\55\71\135\x5b\141\x2d\172\101\55\x5a\x30\55\x39\x2d\x5f\135\52\53\x24\x2f"; static $safeUrlNameToAtt = array("\141" => "\150\162\145\146", "\151\x6d\147" => "\163\162\143"); if (!isset($Element["\156\141\x6d\145"])) { unset($Element["\141\x74\x74\162\151\142\165\164\145\163"]); return $Element; } if (isset($safeUrlNameToAtt[$Element["\x6e\141\155\x65"]])) { $Element = $this->filterUnsafeUrlInAttribute($Element, $safeUrlNameToAtt[$Element["\x6e\141\155\145"]]); } if (!empty($Element["\141\164\164\x72\151\x62\165\x74\x65\163"])) { foreach ($Element["\x61\x74\x74\x72\151\x62\165\164\145\x73"] as $att => $val) { if (!preg_match($goodAttribute, $att)) { unset($Element["\x61\164\x74\x72\x69\142\165\x74\x65\x73"][$att]); } elseif (self::striAtStart($att, "\x6f\x6e")) { unset($Element["\x61\164\164\162\151\x62\165\x74\145\163"][$att]); } } } return $Element; } protected function filterUnsafeUrlInAttribute(array $Element, $attribute) { foreach ($this->safeLinksWhitelist as $scheme) { if (self::striAtStart($Element["\141\164\x74\162\151\142\165\164\145\163"][$attribute], $scheme)) { return $Element; } } $Element["\x61\164\x74\x72\x69\142\x75\164\x65\163"][$attribute] = str_replace("\72", "\45\x33\x41", $Element["\141\x74\x74\x72\x69\x62\165\x74\x65\163"][$attribute]); return $Element; } protected static function escape($text, $allowQuotes = false) { return htmlspecialchars($text, $allowQuotes ? ENT_NOQUOTES : ENT_QUOTES, "\125\124\x46\x2d\x38"); } protected static function striAtStart($string, $needle) { $len = strlen($needle); if ($len > strlen($string)) { return false; } else { return strtolower(substr($string, 0, $len)) === strtolower($needle); } } static function instance($name = "\x64\x65\x66\x61\x75\x6c\164") { if (isset(self::$instances[$name])) { return self::$instances[$name]; } $instance = new static(); self::$instances[$name] = $instance; return $instance; } private static $instances = array(); protected $DefinitionData; protected $specialCharacters = array("\x5c", "\x60", "\52", "\137", "\173", "\175", "\133", "\135", "\50", "\x29", "\76", "\43", "\x2b", "\55", "\x2e", "\x21", "\174", "\x7e"); protected $StrongRegex = array("\x2a" => "\57\x5e\x5b\52\x5d\x7b\62\x7d\50\50\77\72\134\x5c\x5c\52\174\x5b\136\x2a\135\x7c\133\52\x5d\133\x5e\x2a\135\x2a\53\x5b\52\x5d\x29\x2b\77\51\x5b\x2a\135\x7b\x32\x7d\50\77\41\x5b\x2a\x5d\51\x2f\163", "\137" => "\x2f\x5e\x5f\137\x28\x28\77\x3a\134\x5c\137\x7c\133\x5e\137\x5d\x7c\x5f\133\136\x5f\x5d\52\53\137\x29\x2b\x3f\x29\137\x5f\50\x3f\x21\x5f\x29\x2f\165\x73"); protected $EmRegex = array("\x2a" => "\x2f\136\133\x2a\x5d\x28\50\x3f\x3a\x5c\x5c\134\52\174\133\136\x2a\135\x7c\x5b\x2a\135\133\52\x5d\133\136\x2a\135\53\x3f\x5b\x2a\x5d\x5b\52\x5d\x29\x2b\77\51\x5b\x2a\135\x28\x3f\x21\133\x2a\135\51\57\163", "\137" => "\57\x5e\x5f\x28\x28\x3f\72\x5c\x5c\137\x7c\133\136\137\135\x7c\x5f\x5f\x5b\x5e\137\135\52\x5f\137\x29\x2b\77\51\x5f\50\77\x21\137\x29\x5c\x62\x2f\x75\x73"); protected $regexHtmlAttribute = "\x5b\x61\55\172\101\x2d\x5a\137\72\135\133\134\167\x3a\56\55\x5d\x2a\53\50\77\72\134\x73\x2a\x2b\75\x5c\163\52\x2b\x28\x3f\x3a\133\x5e\42\x27\75\74\76\x60\x5c\163\x5d\x2b\x7c\42\133\x5e\42\x5d\52\x2b\42\x7c\47\133\x5e\47\135\52\x2b\x27\x29\x29\77\53"; protected $voidElements = array("\x61\x72\x65\x61", "\x62\x61\x73\145", "\x62\x72", "\143\x6f\x6c", "\x63\157\155\155\141\x6e\144", "\145\x6d\x62\145\x64", "\x68\x72", "\151\155\147", "\x69\156\x70\165\x74", "\x6c\x69\156\153", "\x6d\x65\x74\x61", "\160\x61\x72\141\x6d", "\x73\157\x75\x72\143\x65"); protected $textLevelElements = array("\141", "\142\x72", "\x62\x64\157", "\141\x62\142\x72", "\142\x6c\151\156\x6b", "\x6e\145\x78\x74\151\x64", "\x61\x63\162\157\x6e\x79\155", "\x62\141\x73\145\x66\157\156\164", "\142", "\145\x6d", "\142\x69\x67", "\x63\151\164\145", "\163\155\141\154\x6c", "\163\160\x61\x63\x65\162", "\x6c\x69\163\x74\151\156\147", "\151", "\x72\x70", "\x64\145\x6c", "\143\x6f\x64\145", "\163\x74\x72\x69\x6b\x65", "\x6d\141\x72\x71\165\x65\x65", "\x71", "\x72\164", "\x69\156\x73", "\x66\157\x6e\x74", "\x73\x74\162\x6f\156\x67", "\x73", "\x74\x74", "\153\x62\144", "\x6d\141\162\x6b", "\165", "\x78\x6d", "\163\165\142", "\156\x6f\142\x72", "\x73\x75\x70", "\162\165\142\171", "\x76\141\x72", "\163\160\141\x6e", "\x77\x62\162", "\164\x69\155\x65"); }

Function Calls

None

Variables

None

Stats

MD5 0c5cec21c13bd8a466cf015a10a8e584
Eval Count 0
Decode Time 106 ms