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+