]> sipb.mit.edu Git - ikiwiki.git/blob - doc/bugs/htmlscrubber_undoes_email_obfuscation_by_Text::Markdown.mdwn
f193efc0ca6e54f236ea6aa724d7fd3c4344b15d
[ikiwiki.git] / doc / bugs / htmlscrubber_undoes_email_obfuscation_by_Text::Markdown.mdwn
1 From the source of [[usage]]:
2
3     <a href="mailto:joey@ikiwiki.info">&#x6A;&#111;&#101;&#x79;&#64;i&#107;&#105;w&#105;&#107;&#x69;&#46;&#105;n&#x66;&#x6F;</a>
4
5 Text::Markdown obfuscates email addresses in the href= attribute and in the text.
6 Apparently this can't be configured.
7
8 HTML::Scrubber doesn't set `attr_encoded` for its HTML::Parser, so the href= attribtute is decoded.
9 Currently it seems it doesn't set `attr_encoded` for good reason: so attributes can be sanitized easily,
10 e.g. as in htmlscrubber with `$safe_url_regexp`.
11 This apparently can't be configured either.
12
13 So I can't see an obvious solution to this.
14 Perhaps improvements to Text::Markdown or HTML::Scrubber can allow a fix.
15
16 One question is: how useful is email obfuscation?
17 Don't spammers use HTML parsers?
18
19 > I now see this was noted in the formatting [[/ikiwiki/formatting/discussion]], and won't/can't be fixed.
20 > So I guess this is [[done]]. --Gabriel
21
22 I've [[patch]]ed mdwn.pm to prevent Text::Markdown from obfuscating the emails.
23 The relevant commits are on the master branch of [my "fork" of ikiwiki on Github] [github]:
24
25 - 7d0970adbcf0b63e7e5532c239156f6967d10158
26 - 52c241e723ced4d7c6a702dd08cda37feee75531
27
28 --Gabriel.
29
30 [github]: http://github.com/gmcmanus/ikiwiki/
31
32 > Thanks for coming up with a patch, but overriding
33 > `Text::Markdown::_EncodeEmailAddress` gets into its internals more than
34 > I'm comfortable with.
35
36 > It would probably be best to add an option to [[cpan Text;:Markdown]] to
37 > let the email address munging be disabled. --[[Joey]]