aboutsummaryrefslogtreecommitdiffstats
path: root/vendor
diff options
context:
space:
mode:
Diffstat (limited to 'vendor')
-rwxr-xr-xvendor/bin/html-to-markdown10
-rw-r--r--vendor/composer/autoload_classmap.php1
-rw-r--r--vendor/composer/autoload_static.php1
-rw-r--r--vendor/composer/installed.json20
-rw-r--r--vendor/composer/installed.php10
-rw-r--r--vendor/league/html-to-markdown/.github/renovate.json25
-rw-r--r--vendor/league/html-to-markdown/.github/workflows/tests.yml14
-rw-r--r--vendor/league/html-to-markdown/CHANGELOG.md10
-rw-r--r--vendor/league/html-to-markdown/composer.json18
-rw-r--r--vendor/league/html-to-markdown/src/Coerce.php35
-rw-r--r--vendor/league/html-to-markdown/src/Converter/LinkConverter.php2
-rw-r--r--vendor/league/html-to-markdown/src/Converter/ListItemConverter.php5
-rw-r--r--vendor/league/html-to-markdown/src/Converter/PreformattedConverter.php4
-rw-r--r--vendor/league/html-to-markdown/src/Converter/TableConverter.php3
-rw-r--r--vendor/league/html-to-markdown/src/Element.php10
-rw-r--r--vendor/league/html-to-markdown/src/HtmlConverter.php2
16 files changed, 128 insertions, 42 deletions
diff --git a/vendor/bin/html-to-markdown b/vendor/bin/html-to-markdown
index 51fec89d8..f75df7b84 100755
--- a/vendor/bin/html-to-markdown
+++ b/vendor/bin/html-to-markdown
@@ -108,10 +108,12 @@ if (PHP_VERSION_ID < 80000) {
}
}
- if (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) {
- include("phpvfscomposer://" . __DIR__ . '/..'.'/league/html-to-markdown/bin/html-to-markdown');
- exit(0);
+ if (
+ (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true))
+ || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper'))
+ ) {
+ return include("phpvfscomposer://" . __DIR__ . '/..'.'/league/html-to-markdown/bin/html-to-markdown');
}
}
-include __DIR__ . '/..'.'/league/html-to-markdown/bin/html-to-markdown';
+return include __DIR__ . '/..'.'/league/html-to-markdown/bin/html-to-markdown';
diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php
index 07694ef7b..b60405800 100644
--- a/vendor/composer/autoload_classmap.php
+++ b/vendor/composer/autoload_classmap.php
@@ -282,6 +282,7 @@ return array(
'ID3Parser\\getID3\\getid3_exception' => $vendorDir . '/lukasreschke/id3parser/src/getID3/getid3_exception.php',
'ID3Parser\\getID3\\getid3_handler' => $vendorDir . '/lukasreschke/id3parser/src/getID3/getid3_handler.php',
'ID3Parser\\getID3\\getid3_lib' => $vendorDir . '/lukasreschke/id3parser/src/getID3/getid3_lib.php',
+ 'League\\HTMLToMarkdown\\Coerce' => $vendorDir . '/league/html-to-markdown/src/Coerce.php',
'League\\HTMLToMarkdown\\Configuration' => $vendorDir . '/league/html-to-markdown/src/Configuration.php',
'League\\HTMLToMarkdown\\ConfigurationAwareInterface' => $vendorDir . '/league/html-to-markdown/src/ConfigurationAwareInterface.php',
'League\\HTMLToMarkdown\\Converter\\BlockquoteConverter' => $vendorDir . '/league/html-to-markdown/src/Converter/BlockquoteConverter.php',
diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php
index c34aebc5b..03c928fb2 100644
--- a/vendor/composer/autoload_static.php
+++ b/vendor/composer/autoload_static.php
@@ -519,6 +519,7 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d
'ID3Parser\\getID3\\getid3_exception' => __DIR__ . '/..' . '/lukasreschke/id3parser/src/getID3/getid3_exception.php',
'ID3Parser\\getID3\\getid3_handler' => __DIR__ . '/..' . '/lukasreschke/id3parser/src/getID3/getid3_handler.php',
'ID3Parser\\getID3\\getid3_lib' => __DIR__ . '/..' . '/lukasreschke/id3parser/src/getID3/getid3_lib.php',
+ 'League\\HTMLToMarkdown\\Coerce' => __DIR__ . '/..' . '/league/html-to-markdown/src/Coerce.php',
'League\\HTMLToMarkdown\\Configuration' => __DIR__ . '/..' . '/league/html-to-markdown/src/Configuration.php',
'League\\HTMLToMarkdown\\ConfigurationAwareInterface' => __DIR__ . '/..' . '/league/html-to-markdown/src/ConfigurationAwareInterface.php',
'League\\HTMLToMarkdown\\Converter\\BlockquoteConverter' => __DIR__ . '/..' . '/league/html-to-markdown/src/Converter/BlockquoteConverter.php',
diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json
index 795751ef0..d242c9875 100644
--- a/vendor/composer/installed.json
+++ b/vendor/composer/installed.json
@@ -575,17 +575,17 @@
},
{
"name": "league/html-to-markdown",
- "version": "5.1.0",
- "version_normalized": "5.1.0.0",
+ "version": "5.1.1",
+ "version_normalized": "5.1.1.0",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/html-to-markdown.git",
- "reference": "e0fc8cf07bdabbcd3765341ecb50c34c271d64e1"
+ "reference": "0b4066eede55c48f38bcee4fb8f0aa85654390fd"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/thephpleague/html-to-markdown/zipball/e0fc8cf07bdabbcd3765341ecb50c34c271d64e1",
- "reference": "e0fc8cf07bdabbcd3765341ecb50c34c271d64e1",
+ "url": "https://api.github.com/repos/thephpleague/html-to-markdown/zipball/0b4066eede55c48f38bcee4fb8f0aa85654390fd",
+ "reference": "0b4066eede55c48f38bcee4fb8f0aa85654390fd",
"shasum": ""
},
"require": {
@@ -595,13 +595,13 @@
},
"require-dev": {
"mikehaertl/php-shellcommand": "^1.1.0",
- "phpstan/phpstan": "^0.12.99",
+ "phpstan/phpstan": "^1.8.8",
"phpunit/phpunit": "^8.5 || ^9.2",
"scrutinizer/ocular": "^1.6",
- "unleashedtech/php-coding-standard": "^2.7",
- "vimeo/psalm": "^4.22"
+ "unleashedtech/php-coding-standard": "^2.7 || ^3.0",
+ "vimeo/psalm": "^4.22 || ^5.0"
},
- "time": "2022-03-02T17:24:08+00:00",
+ "time": "2023-07-12T21:21:09+00:00",
"bin": [
"bin/html-to-markdown"
],
@@ -643,7 +643,7 @@
],
"support": {
"issues": "https://github.com/thephpleague/html-to-markdown/issues",
- "source": "https://github.com/thephpleague/html-to-markdown/tree/5.1.0"
+ "source": "https://github.com/thephpleague/html-to-markdown/tree/5.1.1"
},
"funding": [
{
diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php
index 493bd78aa..401eee70e 100644
--- a/vendor/composer/installed.php
+++ b/vendor/composer/installed.php
@@ -3,7 +3,7 @@
'name' => 'zotlabs/hubzilla',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
- 'reference' => '3d1171de8d72d9c400c76fed6e947fef80fa9804',
+ 'reference' => '6920fb2793265e5c9cdcdc8325398b07f216f184',
'type' => 'application',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
@@ -92,9 +92,9 @@
'dev_requirement' => false,
),
'league/html-to-markdown' => array(
- 'pretty_version' => '5.1.0',
- 'version' => '5.1.0.0',
- 'reference' => 'e0fc8cf07bdabbcd3765341ecb50c34c271d64e1',
+ 'pretty_version' => '5.1.1',
+ 'version' => '5.1.1.0',
+ 'reference' => '0b4066eede55c48f38bcee4fb8f0aa85654390fd',
'type' => 'library',
'install_path' => __DIR__ . '/../league/html-to-markdown',
'aliases' => array(),
@@ -304,7 +304,7 @@
'zotlabs/hubzilla' => array(
'pretty_version' => 'dev-master',
'version' => 'dev-master',
- 'reference' => '3d1171de8d72d9c400c76fed6e947fef80fa9804',
+ 'reference' => '6920fb2793265e5c9cdcdc8325398b07f216f184',
'type' => 'application',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
diff --git a/vendor/league/html-to-markdown/.github/renovate.json b/vendor/league/html-to-markdown/.github/renovate.json
new file mode 100644
index 000000000..292bc5592
--- /dev/null
+++ b/vendor/league/html-to-markdown/.github/renovate.json
@@ -0,0 +1,25 @@
+{
+ "$schema": "https://docs.renovatebot.com/renovate-schema.json",
+ "extends": [
+ "config:base",
+ ":disableDependencyDashboard"
+ ],
+ "enabledManagers": ["github-actions", "composer"],
+ "packageRules": [
+ {
+ "matchManagers": ["github-actions"],
+ "extends": ["schedule:weekly"],
+ "automerge": true
+ },
+ {
+ "matchManagers": ["composer"],
+ "matchDepTypes": ["devDependencies"],
+ "rangeStrategy": "widen",
+ "automerge": true
+ },
+ {
+ "matchManagers": ["composer"],
+ "rangeStrategy": "widen"
+ }
+ ]
+}
diff --git a/vendor/league/html-to-markdown/.github/workflows/tests.yml b/vendor/league/html-to-markdown/.github/workflows/tests.yml
index 6abb2de3f..4ea04c983 100644
--- a/vendor/league/html-to-markdown/.github/workflows/tests.yml
+++ b/vendor/league/html-to-markdown/.github/workflows/tests.yml
@@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v3
- uses: shivammathur/setup-php@v2
with:
@@ -28,11 +28,11 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
- php: ['7.2', '7.3', '7.4']
+ php: ['7.2', '7.3', '7.4', '8.0', '8.1']
coverage: [true]
composer-flags: ['']
include:
- - php: '8.0'
+ - php: '8.2'
coverage: false
composer-flags: '--ignore-platform-req=php'
- php: '7.2'
@@ -40,7 +40,7 @@ jobs:
composer-flags: '--prefer-lowest'
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v3
- uses: shivammathur/setup-php@v2
with:
@@ -53,7 +53,7 @@ jobs:
- name: "Use PHPUnit 9.3+ on PHP 8"
run: composer require --no-update --dev phpunit/phpunit:^9.3
- if: "matrix.php == '8.0'"
+ if: "matrix.php >= '8.0'"
- run: composer update --no-progress ${{ matrix.composer-flags }}
@@ -72,7 +72,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v3
- uses: shivammathur/setup-php@v2
with:
@@ -90,7 +90,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v3
- uses: shivammathur/setup-php@v2
with:
diff --git a/vendor/league/html-to-markdown/CHANGELOG.md b/vendor/league/html-to-markdown/CHANGELOG.md
index 60e8e6f24..982e92fac 100644
--- a/vendor/league/html-to-markdown/CHANGELOG.md
+++ b/vendor/league/html-to-markdown/CHANGELOG.md
@@ -4,6 +4,13 @@ Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) princip
## [Unreleased][unreleased]
+## [5.1.1] - 2023-07-12
+
+### Fixed
+
+- Fixed `<pre>` tags with attributes not being parsed (#215, #238)
+- Fixed missing type checks and coercions
+
## [5.1.0] - 2022-03-02
### Changed
@@ -315,7 +322,8 @@ not ideally set, so this releases fixes that. Moving forwards this should reduce
### Added
- Initial release
-[unreleased]: https://github.com/thephpleague/html-to-markdown/compare/5.1.0...master
+[unreleased]: https://github.com/thephpleague/html-to-markdown/compare/5.1.1...master
+[5.1.1]: https://github.com/thephpleague/html-to-markdown/compare/5.1.0...5.1.1
[5.1.0]: https://github.com/thephpleague/html-to-markdown/compare/5.0.2...5.1.0
[5.0.2]: https://github.com/thephpleague/html-to-markdown/compare/5.0.1...5.0.2
[5.0.1]: https://github.com/thephpleague/html-to-markdown/compare/5.0.0...5.0.1
diff --git a/vendor/league/html-to-markdown/composer.json b/vendor/league/html-to-markdown/composer.json
index 22ca054f3..55f2d736c 100644
--- a/vendor/league/html-to-markdown/composer.json
+++ b/vendor/league/html-to-markdown/composer.json
@@ -36,13 +36,25 @@
},
"require-dev": {
"mikehaertl/php-shellcommand": "^1.1.0",
- "phpstan/phpstan": "^0.12.99",
+ "phpstan/phpstan": "^1.8.8",
"phpunit/phpunit": "^8.5 || ^9.2",
"scrutinizer/ocular": "^1.6",
- "unleashedtech/php-coding-standard": "^2.7",
- "vimeo/psalm": "^4.22"
+ "unleashedtech/php-coding-standard": "^2.7 || ^3.0",
+ "vimeo/psalm": "^4.22 || ^5.0"
},
"bin": ["bin/html-to-markdown"],
+ "scripts": {
+ "phpcs": "phpcs",
+ "phpstan": "phpstan analyse",
+ "phpunit": "phpunit --no-coverage",
+ "psalm": "psalm --stats",
+ "test": [
+ "@phpcs",
+ "@phpstan",
+ "@psalm",
+ "@phpunit"
+ ]
+ },
"extra": {
"branch-alias": {
"dev-master": "5.2-dev"
diff --git a/vendor/league/html-to-markdown/src/Coerce.php b/vendor/league/html-to-markdown/src/Coerce.php
new file mode 100644
index 000000000..4fb0450a0
--- /dev/null
+++ b/vendor/league/html-to-markdown/src/Coerce.php
@@ -0,0 +1,35 @@
+<?php
+
+declare(strict_types=1);
+
+namespace League\HTMLToMarkdown;
+
+/**
+ * @internal
+ */
+final class Coerce
+{
+ private function __construct()
+ {
+ }
+
+ /**
+ * @param mixed $val
+ */
+ public static function toString($val): string
+ {
+ switch (true) {
+ case \is_string($val):
+ return $val;
+ case \is_bool($val):
+ case \is_float($val):
+ case \is_int($val):
+ case $val === null:
+ return \strval($val);
+ case \is_object($val) && \method_exists($val, '__toString'):
+ return $val->__toString();
+ default:
+ throw new \InvalidArgumentException('Cannot coerce this value to string');
+ }
+ }
+}
diff --git a/vendor/league/html-to-markdown/src/Converter/LinkConverter.php b/vendor/league/html-to-markdown/src/Converter/LinkConverter.php
index 25a3540fe..f0ba157f8 100644
--- a/vendor/league/html-to-markdown/src/Converter/LinkConverter.php
+++ b/vendor/league/html-to-markdown/src/Converter/LinkConverter.php
@@ -72,6 +72,6 @@ class LinkConverter implements ConverterInterface, ConfigurationAwareInterface
private function shouldStrip(): bool
{
- return $this->config->getOption('strip_placeholder_links') ?? false;
+ return \boolval($this->config->getOption('strip_placeholder_links') ?? false);
}
}
diff --git a/vendor/league/html-to-markdown/src/Converter/ListItemConverter.php b/vendor/league/html-to-markdown/src/Converter/ListItemConverter.php
index 1521aad53..d71f601e1 100644
--- a/vendor/league/html-to-markdown/src/Converter/ListItemConverter.php
+++ b/vendor/league/html-to-markdown/src/Converter/ListItemConverter.php
@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace League\HTMLToMarkdown\Converter;
+use League\HTMLToMarkdown\Coerce;
use League\HTMLToMarkdown\Configuration;
use League\HTMLToMarkdown\ConfigurationAwareInterface;
use League\HTMLToMarkdown\ElementInterface;
@@ -38,8 +39,8 @@ class ListItemConverter implements ConverterInterface, ConfigurationAwareInterfa
}
if ($listType === 'ul') {
- $listItemStyle = $this->config->getOption('list_item_style', '-');
- $listItemStyleAlternate = $this->config->getOption('list_item_style_alternate');
+ $listItemStyle = Coerce::toString($this->config->getOption('list_item_style', '-'));
+ $listItemStyleAlternate = Coerce::toString($this->config->getOption('list_item_style_alternate', ''));
if (! isset($this->listItemStyle)) {
$this->listItemStyle = $listItemStyleAlternate ?: $listItemStyle;
}
diff --git a/vendor/league/html-to-markdown/src/Converter/PreformattedConverter.php b/vendor/league/html-to-markdown/src/Converter/PreformattedConverter.php
index 7d8ccc132..af6dd1051 100644
--- a/vendor/league/html-to-markdown/src/Converter/PreformattedConverter.php
+++ b/vendor/league/html-to-markdown/src/Converter/PreformattedConverter.php
@@ -11,7 +11,9 @@ class PreformattedConverter implements ConverterInterface
public function convert(ElementInterface $element): string
{
$preContent = \html_entity_decode($element->getChildrenAsString());
- $preContent = \str_replace(['<pre>', '</pre>'], '', $preContent);
+ $preContent = \preg_replace('/<pre\b[^>]*>/', '', $preContent);
+ \assert($preContent !== null);
+ $preContent = \str_replace('</pre>', '', $preContent);
/*
* Checking for the code tag.
diff --git a/vendor/league/html-to-markdown/src/Converter/TableConverter.php b/vendor/league/html-to-markdown/src/Converter/TableConverter.php
index 2e63e9a5b..91e718076 100644
--- a/vendor/league/html-to-markdown/src/Converter/TableConverter.php
+++ b/vendor/league/html-to-markdown/src/Converter/TableConverter.php
@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace League\HTMLToMarkdown\Converter;
+use League\HTMLToMarkdown\Coerce;
use League\HTMLToMarkdown\Configuration;
use League\HTMLToMarkdown\ConfigurationAwareInterface;
use League\HTMLToMarkdown\ElementInterface;
@@ -89,7 +90,7 @@ class TableConverter implements ConverterInterface, PreConverterInterface, Confi
}
$value = \str_replace("\n", ' ', $value);
- $value = \str_replace('|', $this->config->getOption('table_pipe_escape') ?? '\|', $value);
+ $value = \str_replace('|', Coerce::toString($this->config->getOption('table_pipe_escape') ?? '\|'), $value);
return '| ' . \trim($value) . ' ';
case 'thead':
diff --git a/vendor/league/html-to-markdown/src/Element.php b/vendor/league/html-to-markdown/src/Element.php
index 0515b5995..ef3ecfa9a 100644
--- a/vendor/league/html-to-markdown/src/Element.php
+++ b/vendor/league/html-to-markdown/src/Element.php
@@ -98,6 +98,8 @@ class Element implements ElementInterface
{
$ret = [];
foreach ($this->node->childNodes as $node) {
+ /** @psalm-suppress RedundantCondition */
+ \assert($node instanceof \DOMNode);
$ret[] = new self($node);
}
@@ -116,7 +118,7 @@ class Element implements ElementInterface
return $this->nextCached;
}
- private function getNextNode(\DomNode $node, bool $checkChildren = true): ?\DomNode
+ private function getNextNode(\DOMNode $node, bool $checkChildren = true): ?\DOMNode
{
if ($checkChildren && $node->firstChild) {
return $node->firstChild;
@@ -142,11 +144,7 @@ class Element implements ElementInterface
$tagNames = [$tagNames];
}
- for ($p = $this->node->parentNode; $p !== false; $p = $p->parentNode) {
- if ($p === null) {
- return false;
- }
-
+ for ($p = $this->node->parentNode; $p !== null; $p = $p->parentNode) {
if (\in_array($p->nodeName, $tagNames, true)) {
return true;
}
diff --git a/vendor/league/html-to-markdown/src/HtmlConverter.php b/vendor/league/html-to-markdown/src/HtmlConverter.php
index 7162b256d..944cb081b 100644
--- a/vendor/league/html-to-markdown/src/HtmlConverter.php
+++ b/vendor/league/html-to-markdown/src/HtmlConverter.php
@@ -212,7 +212,7 @@ class HtmlConverter implements HtmlConverterInterface
$tag = $element->getTagName();
// Strip nodes named in remove_nodes
- $tagsToRemove = \explode(' ', $this->getConfig()->getOption('remove_nodes') ?? '');
+ $tagsToRemove = \explode(' ', Coerce::toString($this->getConfig()->getOption('remove_nodes') ?? ''));
if (\in_array($tag, $tagsToRemove, true)) {
return '';
}