aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/league/html-to-markdown/src/Converter/LinkConverter.php
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 /vendor/league/html-to-markdown/src/Converter/LinkConverter.php
parent32bdf42913518b3421986cb4d49d62ed1b04354e (diff)
downloadvolse-hubzilla-88a68f96da303893d911f09c25088d4f8288b5fb.tar.gz
volse-hubzilla-88a68f96da303893d911f09c25088d4f8288b5fb.tar.bz2
volse-hubzilla-88a68f96da303893d911f09c25088d4f8288b5fb.zip
composer update html-to-markdown
Diffstat (limited to 'vendor/league/html-to-markdown/src/Converter/LinkConverter.php')
-rw-r--r--vendor/league/html-to-markdown/src/Converter/LinkConverter.php19
1 files changed, 17 insertions, 2 deletions
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);
}
/**