MDL-60238 libraries: Upgrade HTML2Text to 4.1.0

This commit is contained in:
Ankit Agarwal
2017-10-02 08:43:33 +05:30
parent 23ab0d7788
commit c56c1d98a3
2 changed files with 17 additions and 1 deletions
+16
View File
@@ -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 . ']';
}
}