vwochnik / jekyll-email-protect

Email protection liquid filter for Jekyll
MIT License
90 stars 11 forks source link

Another encode format for emails. #6

Closed andreySadomovskiy closed 6 years ago

andreySadomovskiy commented 6 years ago

Is it possible to add one more encode format for emails to have possibility to show email link name on HTML page? To encode not only href, but link name also.

For example: yourname@domain.com

<a href="mailto:
&#121;&#111;&#117;&#114;&#110;&#097;&#109;&#101;&#064;&#100;&#111;&#109;&#097;&#105;&#110;&#046;&#099;&#111;&#109;">
&#121;&#111;&#117;&#114;&#110;&#097;&#109;&#101;&#064;&#100;&#111;&#109;&#097;&#105;&#110;&#046;&#099;&#111;&#109;
</a>
vwochnik commented 6 years ago

Added and published. You can now do this:

<a href="mailto:{{ site.email | encode_email }}">{{ site.email | html_encode_email }}</a>
andreySadomovskiy commented 6 years ago

What I am doing wrong?

I have updated plugin: gem update jekyll-email-protect Updated code as in example <a href="mailto:{{ site.email.sales | encode_email }}">{{ site.email.sales | html_encode_email }}</a> but href is encoded and link name not.

andreySadomovskiy commented 6 years ago

I found the reason — Gemfile.lock

Many thanks!