joomla/joomla-cms — pull request #1396 by nonumber (2013-07-02 14:40:41+00:00)
Title: Changed the way the email cloaking plugin works

This PR introduces a completely new approach to the email cloaking plugin.

#### Issues with current plugin
The current core email cloaking plugin is pretty bad and has been for years.

One issue is that it uses document.write to place a javascript encoded email address. The document.write causes issues with other scripts (like inline modal scripts).

Another issue is that it also converts email addresses inside inline scripts, causing these to completely be messed up (scripts inside scripts).

These are both fixed with this new Email Cloaking plugin.

#### No more javascript in output
This plugin doesn't output a javascript to generate the html, but outputs a link with a series of span elements. The email address id distributed in parts over data-content attributes in these spans.
Then by using some short css and javascript the email address is displayed correctly and the mailto is added to the link.

The result is a readable email address in the browser, but a bunch of spans with unrecognisable attributes in the html.

#### Testing instructions
You can test (and compare to old functionality) if the email addresses are being output correctly (together with the correct mailto link). For instance, use this as example:
```

Email in text: my@email.com

Email with mailto link: my@email.com

Email with mailto link with an id: my@email.com

Email with mailto link to other email address than text: someoneelse@email.com

Email with mailto link and custom text My Email

```

Also good to test what happens when there is an email address inside a javascript block. It should be left alone.
So you can try placing this code inside an article (make sure your editor allows placing scripts):
```

```