Skip to content

AndrewPrifer/hexo-helper-obfuscate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

hexo-helper-obfuscate

Hexo helper plugin for obfuscating strings such as email addresses. Handy against web-crawlers.

Install

npm install hexo-helper-obfuscate --save

Usage

<a href="mailto:<%- obfuscate('jdoe@example.com')" %>>Email</a>

The helper will encode the characters of the string in html entities, randomly choosing between ascii and utf-8 representation. The result will look like this:

<a href="mailto:&#x006A;&#x0064;&#111;&#101;&#64;&#x0065;&#x0078;&#x0061;&#x006D;&#112;&#x006C;&#101;&#46;&#x0063;&#111;&#x006D;">Email</a>

Make sure to use <%- obfuscate() %> and not <%= obfuscate() %> to prevent EJS from escaping the generated string.

About

Hexo helper for obfuscating strings such as email addresses. Handy against web-crawlers.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published