PostHTML Obfuscate
Obfuscates emails to make it harder for bots to recognize emails.
Install
npm i posthtml-obfuscate -D
Output
<a href="mailto:sam@smith.com">
sam@smith.com
</a>
<a href="mailto:sam@smith.com">
sam@smith.com
</a>
Usage
const posthtml = require('posthtml');
const phObfuscate= require('posthtml-obfuscate');
const options = {
includeMailto: false
};
posthtml([phObfuscate(options)])
.process(myHtml)
.then(result => {
console.log(result.html);
});
Options
includeMailto
: Boolean - Includes the mailto:
prefix in the obfuscation. (Default: false)