aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2020-08-22 19:56:28 +0200
committerMario Vavti <mario@mariovavti.com>2020-08-22 19:56:28 +0200
commit88a68f96da303893d911f09c25088d4f8288b5fb (patch)
tree65bc81e92f02cbf253c5ab2d92e9c3f2bd2cb39e
parent32bdf42913518b3421986cb4d49d62ed1b04354e (diff)
downloadvolse-hubzilla-88a68f96da303893d911f09c25088d4f8288b5fb.tar.gz
volse-hubzilla-88a68f96da303893d911f09c25088d4f8288b5fb.tar.bz2
volse-hubzilla-88a68f96da303893d911f09c25088d4f8288b5fb.zip
composer update html-to-markdown
-rw-r--r--SBOM.md2
-rw-r--r--composer.lock28
-rw-r--r--vendor/composer/installed.json30
-rw-r--r--vendor/league/html-to-markdown/.github/FUNDING.yml1
-rw-r--r--vendor/league/html-to-markdown/CHANGELOG.md8
-rw-r--r--vendor/league/html-to-markdown/README.md15
-rw-r--r--vendor/league/html-to-markdown/src/Converter/LinkConverter.php19
-rw-r--r--vendor/league/html-to-markdown/src/HtmlConverter.php1
8 files changed, 89 insertions, 15 deletions
diff --git a/SBOM.md b/SBOM.md
index 5bb93ce79..e54b4d4ac 100644
--- a/SBOM.md
+++ b/SBOM.md
@@ -7,7 +7,7 @@
|commerceguys/intl|1.0.5.0|MIT|https://github.com/commerceguys/intl.git|
|desandro/imagesloaded|4.1.4.0|MIT|https://github.com/desandro/imagesloaded.git|
|ezyang/htmlpurifier|4.13.0.0|LGPL-2.1-or-later|https://github.com/ezyang/htmlpurifier.git|
-|league/html-to-markdown|4.9.1.0|MIT|https://github.com/thephpleague/html-to-markdown.git|
+|league/html-to-markdown|4.10.0.0|MIT|https://github.com/thephpleague/html-to-markdown.git|
|lukasreschke/id3parser|0.0.3.0|GPL|https://github.com/LukasReschke/ID3Parser.git|
|michelf/php-markdown|1.9.0.0|BSD-3-Clause|https://github.com/michelf/php-markdown.git|
|paragonie/random_compat|9.99.99.0|MIT|https://github.com/paragonie/random_compat.git|
diff --git a/composer.lock b/composer.lock
index ee5fddaf1..1c8c777fa 100644
--- a/composer.lock
+++ b/composer.lock
@@ -260,16 +260,16 @@
},
{
"name": "league/html-to-markdown",
- "version": "4.9.1",
+ "version": "4.10.0",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/html-to-markdown.git",
- "reference": "1dcd0f85de786f46a7f224a27cc3d709ddd2a68c"
+ "reference": "0868ae7a552e809e5cd8f93ba022071640408e88"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/thephpleague/html-to-markdown/zipball/1dcd0f85de786f46a7f224a27cc3d709ddd2a68c",
- "reference": "1dcd0f85de786f46a7f224a27cc3d709ddd2a68c",
+ "url": "https://api.github.com/repos/thephpleague/html-to-markdown/zipball/0868ae7a552e809e5cd8f93ba022071640408e88",
+ "reference": "0868ae7a552e809e5cd8f93ba022071640408e88",
"shasum": ""
},
"require": {
@@ -320,7 +320,25 @@
"html",
"markdown"
],
- "time": "2019-12-28T01:32:28+00:00"
+ "funding": [
+ {
+ "url": "https://www.colinodell.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://www.paypal.me/colinpodell/10.00",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/colinodell",
+ "type": "github"
+ },
+ {
+ "url": "https://www.patreon.com/colinodell",
+ "type": "patreon"
+ }
+ ],
+ "time": "2020-07-01T00:34:03+00:00"
},
{
"name": "lukasreschke/id3parser",
diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json
index 5de750e76..82936174b 100644
--- a/vendor/composer/installed.json
+++ b/vendor/composer/installed.json
@@ -263,17 +263,17 @@
},
{
"name": "league/html-to-markdown",
- "version": "4.9.1",
- "version_normalized": "4.9.1.0",
+ "version": "4.10.0",
+ "version_normalized": "4.10.0.0",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/html-to-markdown.git",
- "reference": "1dcd0f85de786f46a7f224a27cc3d709ddd2a68c"
+ "reference": "0868ae7a552e809e5cd8f93ba022071640408e88"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/thephpleague/html-to-markdown/zipball/1dcd0f85de786f46a7f224a27cc3d709ddd2a68c",
- "reference": "1dcd0f85de786f46a7f224a27cc3d709ddd2a68c",
+ "url": "https://api.github.com/repos/thephpleague/html-to-markdown/zipball/0868ae7a552e809e5cd8f93ba022071640408e88",
+ "reference": "0868ae7a552e809e5cd8f93ba022071640408e88",
"shasum": ""
},
"require": {
@@ -286,7 +286,7 @@
"phpunit/phpunit": "^4.8|^5.7",
"scrutinizer/ocular": "~1.1"
},
- "time": "2019-12-28T01:32:28+00:00",
+ "time": "2020-07-01T00:34:03+00:00",
"bin": [
"bin/html-to-markdown"
],
@@ -325,6 +325,24 @@
"keywords": [
"html",
"markdown"
+ ],
+ "funding": [
+ {
+ "url": "https://www.colinodell.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://www.paypal.me/colinpodell/10.00",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/colinodell",
+ "type": "github"
+ },
+ {
+ "url": "https://www.patreon.com/colinodell",
+ "type": "patreon"
+ }
]
},
{
diff --git a/vendor/league/html-to-markdown/.github/FUNDING.yml b/vendor/league/html-to-markdown/.github/FUNDING.yml
index 40a26fbff..11ea19c6c 100644
--- a/vendor/league/html-to-markdown/.github/FUNDING.yml
+++ b/vendor/league/html-to-markdown/.github/FUNDING.yml
@@ -1,2 +1,3 @@
github: colinodell
patreon: colinodell
+custom: ["https://www.colinodell.com/sponsor", "https://www.paypal.me/colinpodell/10.00"]
diff --git a/vendor/league/html-to-markdown/CHANGELOG.md b/vendor/league/html-to-markdown/CHANGELOG.md
index 9ce8e8b2d..c19cd9f69 100644
--- a/vendor/league/html-to-markdown/CHANGELOG.md
+++ b/vendor/league/html-to-markdown/CHANGELOG.md
@@ -4,6 +4,11 @@ Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) princip
## [Unreleased][unreleased]
+## [4.10.0] - 2020-06-30
+### Added
+
+ - Added the ability to disable autolinking with a configuration option (#187, #188)
+
## [4.9.1] - 2019-12-27
### Fixed
- Fixed issue with HTML entity escaping in text (#184)
@@ -263,7 +268,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/4.9.1...master
+[unreleased]: https://github.com/thephpleague/html-to-markdown/compare/4.10.0...master
+[4.10.0]: https://github.com/thephpleague/html-to-markdown/compare/4.9.1...4.10.0
[4.9.1]: https://github.com/thephpleague/html-to-markdown/compare/4.9.0...4.9.1
[4.9.0]: https://github.com/thephpleague/html-to-markdown/compare/4.8.3...4.9.0
[4.8.3]: https://github.com/thephpleague/html-to-markdown/compare/4.8.2...4.8.3
diff --git a/vendor/league/html-to-markdown/README.md b/vendor/league/html-to-markdown/README.md
index c7ae2dcab..c1ac805ab 100644
--- a/vendor/league/html-to-markdown/README.md
+++ b/vendor/league/html-to-markdown/README.md
@@ -141,6 +141,21 @@ $converter->getConfig()->setOption('hard_break', false); // default
$markdown = $converter->convert($html); // $markdown now contains "test \nline break"
```
+### Autolinking options
+
+By default, `a` tags are converted to the easiest possible link syntax, i.e. if no text or title is available, then the `<url>` syntax will be used rather than the full `[url](url)` syntax. Set `use_autolinks` to `false` to change this behavior to always use the full link syntax.
+
+```php
+$converter = new HtmlConverter();
+$html = '<p><a href="https://thephpleague.com">https://thephpleague.com</a></p>';
+
+$converter->getConfig()->setOption('use_autolinks', true);
+$markdown = $converter->convert($html); // $markdown now contains "<https://thephpleague.com>"
+
+$converter->getConfig()->setOption('use_autolinks', false); // default
+$markdown = $converter->convert($html); // $markdown now contains "[https://google.com](https://google.com)"
+```
+
### Passing custom Environment object
You can pass current `Environment` object to customize i.e. which converters should be used.
diff --git a/vendor/league/html-to-markdown/src/Converter/LinkConverter.php b/vendor/league/html-to-markdown/src/Converter/LinkConverter.php
index 81c18b65f..ed52619d2 100644
--- a/vendor/league/html-to-markdown/src/Converter/LinkConverter.php
+++ b/vendor/league/html-to-markdown/src/Converter/LinkConverter.php
@@ -2,11 +2,25 @@
namespace League\HTMLToMarkdown\Converter;
+use League\HTMLToMarkdown\Configuration;
+use League\HTMLToMarkdown\ConfigurationAwareInterface;
use League\HTMLToMarkdown\ElementInterface;
-class LinkConverter implements ConverterInterface
+class LinkConverter implements ConverterInterface, ConfigurationAwareInterface
{
/**
+ * @var Configuration
+ */
+ protected $config;
+
+ /**
+ * @param Configuration $config
+ */
+ public function setConfig(Configuration $config) {
+ $this->config = $config;
+ }
+
+ /**
* @param ElementInterface $element
*
* @return string
@@ -52,7 +66,8 @@ class LinkConverter implements ConverterInterface
*/
private function isValidAutolink($href)
{
- return preg_match('/^[A-Za-z][A-Za-z0-9.+-]{1,31}:[^<>\x00-\x20]*/i', $href) === 1;
+ $useAutolinks = $this->config->getOption('use_autolinks');
+ return $useAutolinks && (preg_match('/^[A-Za-z][A-Za-z0-9.+-]{1,31}:[^<>\x00-\x20]*/i', $href) === 1);
}
/**
diff --git a/vendor/league/html-to-markdown/src/HtmlConverter.php b/vendor/league/html-to-markdown/src/HtmlConverter.php
index 846131af6..6f98e97b4 100644
--- a/vendor/league/html-to-markdown/src/HtmlConverter.php
+++ b/vendor/league/html-to-markdown/src/HtmlConverter.php
@@ -41,6 +41,7 @@ class HtmlConverter implements HtmlConverterInterface
'hard_break' => false, // Set to true to turn <br> into `\n` instead of ` \n`
'list_item_style' => '-', // Set the default character for each <li> in a <ul>. Can be '-', '*', or '+'
'preserve_comments' => false, // Set to true to preserve comments, or set to an array of strings to preserve specific comments
+ 'use_autolinks' => true, // Set to true to use simple link syntax if possible. Will always use []() if set to false
);
$this->environment = Environment::createDefaultEnvironment($defaults);