I have a problem with this PR. After making a lot of things and then simplifying it, it seems to me that is does not fix what we want. The mailto has never been a problem and was already managed.
A mail writen in the form
[rte-inspire-infos-france.com](mailto:rte-inspire-infos-france.com) will be put in a
<a> tag whitout href, which is what we want.
The problem that led to the creation of the issue was that an email written in the form
rte-inspire-infos-france.com will be put in
rte-inspire-infos<a href="http://-france.com" rel="nofollow">-france.com</a>.
This is clearly stated in the issue and after testing this PR does not fix this. It actually tries to fix something not broken
So I think you might have gotten quite lost here.
That's a bit true indeed :) cos I tried a bit to find a solution allowing a setting 'ALLOW_MAILTO', but I scratched that today and I missed (again) some errors...
Also just to prove you the bleaching as it was was far from working ok just try the following, add a text like that in a dataset in the live datagouv website :
test **BLEACH** link 01 : [rte-inspire-01-france.com](mailto:rte-inspire-infos-france.com) link 02 : rte-inspire-02-france.com link 03 : [rte-france-03.com](rte-france-03.com) link 03b : [rte-france-03b.com/route](rte-france-03b.com/route) link 04 : rte-france-04.com link 04b : rte-france-04b.com/route link 05 : www.rte-france-05.com link 05b : www.rte-france-05b.com/route link 06 : [www.rte-france-06.com](www.rte-france-06.com) link 06b : [www.rte-france-06b.com/route](www.rte-france-06b.com/route) link 07 : [local/route/rte-france-07](/local/route/rte-france-07) link 08 : [/ ... root-08](/)
datagouv today =>
This PR =>
Now I think the original issue is fixed BUT there is perhaps another issue to open (?) : I noticed the text you add in the admin part made different results in the admin frontend and in the public frontend... that's a bit weird...
You'll have those results quite different if you're either seeing the text on the admin part of the udata, or seeing it from the public part of udata :
The admin with this PR (still problematic) =>
I would consider this PR fixes the original issue (the problem on the public rendering of a text, neutralizing
mailto: hrefs), but not on the admin part... For now I admit I don't understand why is there two separate ways to display the same text and why it is behaving like that, that's why I'd propose to open a distinct issue to cover that...