From c56c1d98a39aab02b4f28842a96fb9f4c30f847d Mon Sep 17 00:00:00 2001 From: Ankit Agarwal Date: Mon, 2 Oct 2017 08:08:32 +0530 Subject: [PATCH] MDL-60238 libraries: Upgrade HTML2Text to 4.1.0 --- lib/html2text/Html2Text.php | 16 ++++++++++++++++ lib/thirdpartylibs.xml | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/lib/html2text/Html2Text.php b/lib/html2text/Html2Text.php index 0ed5e404d66..5001b2ffd60 100644 --- a/lib/html2text/Html2Text.php +++ b/lib/html2text/Html2Text.php @@ -243,6 +243,16 @@ class Html2Text : ENT_COMPAT | ENT_HTML5; } + /** + * Get the source HTML + * + * @return string + */ + public function getHtml() + { + return $this->html; + } + /** * Set the source HTML * @@ -424,10 +434,16 @@ class Html2Text return $display . ' [' . ($index + 1) . ']'; } elseif ($linkMethod == 'nextline') { + if ($url === $display) { + return $display; + } return $display . "\n[" . $url . ']'; } elseif ($linkMethod == 'bbcode') { return sprintf('[url=%s]%s[/url]', $url, $display); } else { // link_method defaults to inline + if ($url === $display) { + return $display; + } return $display . ' [' . $url . ']'; } } diff --git a/lib/thirdpartylibs.xml b/lib/thirdpartylibs.xml index 71400eaf826..4f700c67a8a 100644 --- a/lib/thirdpartylibs.xml +++ b/lib/thirdpartylibs.xml @@ -172,7 +172,7 @@ html2text HTML2Text GPL - 4.0.1 + 4.1.0 2.0+