Skip to content
Snippets Groups Projects
Commit 96832056 authored by Jared Hancock's avatar Jared Hancock
Browse files

html2text: Avoid long, wrapped URLs in a tags

parent 9c9bfae1
No related branches found
No related tags found
No related merge requests found
...@@ -448,6 +448,11 @@ class HtmlAElement extends HtmlInlineElement { ...@@ -448,6 +448,11 @@ class HtmlAElement extends HtmlInlineElement {
$href = substr($href, 7); $href = substr($href, 7);
$output = (($href != $output) ? "$href " : '') . "<$output>"; $output = (($href != $output) ? "$href " : '') . "<$output>";
} elseif (mb_strwidth($href) > $width / 2) { } elseif (mb_strwidth($href) > $width / 2) {
if (mb_strwidth($output) > $width / 2) {
// Parse URL and use relative path part
if ($PU = parse_url($output))
$output = $PU['host'] . $PU['path'];
}
if ($href != $output) if ($href != $output)
$id = $this->getRoot()->addFootnote($output, $href); $id = $this->getRoot()->addFootnote($output, $href);
$output = "[$output][$id]"; $output = "[$output][$id]";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment