HtmlPurifier: Display hostnames only with Linkify

238 views Asked by At

Of course you've might heard about HtmlPurifier. I'm using linkify functionality - automatically convert urls to a tags. So, now I want to display only hostnames but leave full url in href attribute.

Example:

http://www.website.com/article/123-some-cool-article.html

should be converted to

<a href="http://www.website.com/article/123-some-cool-article.html">http://www.website.com</a>

Is that possible?

1

There are 1 answers

0
Edward Z. Yang On BEST ANSWER

Not directly, although this would be a trivial patch to Linkify.php.