Welcome! » Log In » Create A New Profile

Multilingual projects: Add array with hosts for isLocal?

Posted by KillerBee 
Multilingual projects: Add array with hosts for isLocal?
November 23, 2016 08:38AM

I want add

http://htmlpurifier.org/live/configdoc/plain.html#HTML.Nofollow

for outgoing links. My project is multilingual, so I have different domains like

1. www.domainA.com 2. abc.domainA.com 3. www.domainB.de 4. www.domainC.fr

That all no need a "nofollow", all domains point to the identical web-content, only GUI is translated.

http://htmlpurifier.org/live/configdoc/plain.html#URI.Host

is only for a single string value. Is here a way to add valid hosts or exclude domains for nofollow?

Re: Multilingual projects: Add array with hosts for isLocal?
November 23, 2016 10:51AM

There's no way to do this with the given config options. But it's not too hard to adapt library/HTMLPurifier/AttrTransform/Nofollow.php into the version you need (you could patch it first; but you can also use http://htmlpurifier.org/docs/enduser-customize.html to write your own AttrTransform class, and then register it yourself.)

Author:
Your Email:

Subject:

HTML input is enabled. Make sure you escape all HTML and angled brackets with < and >.

Auto-paragraphing is enabled. Double newlines will be converted to paragraphs; for single newlines, use the pre tag.

Allowed tags: a, abbr, acronym, b, blockquote, caption, cite, code, dd, del, dfn, div, dl, dt, em, i, ins, kbd, li, ol, p, pre, s, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, var.

For inputting literal code such as HTML and PHP for display, use CDATA tags to auto-escape your angled brackets, and pre to preserve newlines:

<pre><![CDATA[
Place code here
]]></pre>

Power users, you can hide this notice with:

.htmlpurifier-help {display:none;}

Message: