update third party libraries
This commit is contained in:
parent
e751b692c2
commit
abd24964e2
2 changed files with 15 additions and 12 deletions
8
src/web/third_party/parsedown.php
vendored
8
src/web/third_party/parsedown.php
vendored
|
@ -17,7 +17,7 @@ class Parsedown
|
||||||
{
|
{
|
||||||
# ~
|
# ~
|
||||||
|
|
||||||
const version = '1.8.0-beta-7';
|
const version = '1.8.0';
|
||||||
|
|
||||||
# ~
|
# ~
|
||||||
|
|
||||||
|
@ -571,7 +571,7 @@ class Parsedown
|
||||||
#
|
#
|
||||||
# List
|
# List
|
||||||
|
|
||||||
protected function blockList($Line, array $CurrentBlock = null)
|
protected function blockList($Line, ?array $CurrentBlock = null)
|
||||||
{
|
{
|
||||||
list($name, $pattern) = $Line['text'][0] <= '-' ? array('ul', '[*+-]') : array('ol', '[0-9]{1,9}+[.\)]');
|
list($name, $pattern) = $Line['text'][0] <= '-' ? array('ul', '[*+-]') : array('ol', '[0-9]{1,9}+[.\)]');
|
||||||
|
|
||||||
|
@ -808,7 +808,7 @@ class Parsedown
|
||||||
#
|
#
|
||||||
# Setext
|
# Setext
|
||||||
|
|
||||||
protected function blockSetextHeader($Line, array $Block = null)
|
protected function blockSetextHeader($Line, ?array $Block = null)
|
||||||
{
|
{
|
||||||
if ( ! isset($Block) or $Block['type'] !== 'Paragraph' or isset($Block['interrupted']))
|
if ( ! isset($Block) or $Block['type'] !== 'Paragraph' or isset($Block['interrupted']))
|
||||||
{
|
{
|
||||||
|
@ -894,7 +894,7 @@ class Parsedown
|
||||||
#
|
#
|
||||||
# Table
|
# Table
|
||||||
|
|
||||||
protected function blockTable($Line, array $Block = null)
|
protected function blockTable($Line, ?array $Block = null)
|
||||||
{
|
{
|
||||||
if ( ! isset($Block) or $Block['type'] !== 'Paragraph' or isset($Block['interrupted']))
|
if ( ! isset($Block) or $Block['type'] !== 'Paragraph' or isset($Block['interrupted']))
|
||||||
{
|
{
|
||||||
|
|
19
src/web/third_party/parsedown_extra.php
vendored
19
src/web/third_party/parsedown_extra.php
vendored
|
@ -17,7 +17,7 @@ class ParsedownExtra extends Parsedown
|
||||||
{
|
{
|
||||||
# ~
|
# ~
|
||||||
|
|
||||||
const version = '0.8.0';
|
const version = '0.8.2';
|
||||||
|
|
||||||
# ~
|
# ~
|
||||||
|
|
||||||
|
@ -331,7 +331,7 @@ class ParsedownExtra extends Parsedown
|
||||||
#
|
#
|
||||||
# Setext
|
# Setext
|
||||||
|
|
||||||
protected function blockSetextHeader($Line, array $Block = null)
|
protected function blockSetextHeader($Line, ?array $Block = null)
|
||||||
{
|
{
|
||||||
$Block = parent::blockSetextHeader($Line, $Block);
|
$Block = parent::blockSetextHeader($Line, $Block);
|
||||||
|
|
||||||
|
@ -508,7 +508,7 @@ class ParsedownExtra extends Parsedown
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
uasort($this->DefinitionData['Footnote'], 'self::sortFootnotes');
|
uasort($this->DefinitionData['Footnote'], [$this, 'sortFootnotes']);
|
||||||
|
|
||||||
foreach ($this->DefinitionData['Footnote'] as $definitionId => $DefinitionData)
|
foreach ($this->DefinitionData['Footnote'] as $definitionId => $DefinitionData)
|
||||||
{
|
{
|
||||||
|
@ -624,12 +624,15 @@ class ParsedownExtra extends Parsedown
|
||||||
|
|
||||||
$DOMDocument = new DOMDocument;
|
$DOMDocument = new DOMDocument;
|
||||||
|
|
||||||
# http://stackoverflow.com/q/11309194/200145
|
# https://www.php.net/manual/en/domdocument.loadhtml.php#95251
|
||||||
$elementMarkup = mb_convert_encoding($elementMarkup, 'HTML-ENTITIES', 'UTF-8');
|
$DOMDocument->loadHTML('<?xml encoding="UTF-8"?>' . $elementMarkup);
|
||||||
|
|
||||||
# http://stackoverflow.com/q/4879946/200145
|
|
||||||
$DOMDocument->loadHTML($elementMarkup);
|
|
||||||
$DOMDocument->removeChild($DOMDocument->doctype);
|
$DOMDocument->removeChild($DOMDocument->doctype);
|
||||||
|
foreach ($DOMDocument->childNodes as $Node) {
|
||||||
|
if ($Node->nodeType === XML_PI_NODE) {
|
||||||
|
$DOMDocument->removeChild($Node);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$DOMDocument->encoding = 'UTF-8';
|
||||||
$DOMDocument->replaceChild($DOMDocument->firstChild->firstChild->firstChild, $DOMDocument->firstChild);
|
$DOMDocument->replaceChild($DOMDocument->firstChild->firstChild->firstChild, $DOMDocument->firstChild);
|
||||||
|
|
||||||
$elementText = '';
|
$elementText = '';
|
||||||
|
|
Loading…
Reference in a new issue