OLD | NEW |
(Empty) | |
| 1 title=Address Masking |
| 2 description=Use address masking to avoid spam. |
| 3 |
| 4 # Address masking |
| 5 |
| 6 Use address masking to avoid spam. |
| 7 |
| 8 ## Usage |
| 9 |
| 10 ### Step 1: Include script on page |
| 11 |
| 12 Include the following script at the bottom of a page: |
| 13 |
| 14 ``` |
| 15 <script src="/js/address-masking.js"></script> |
| 16 ``` |
| 17 |
| 18 ### Step 2: Base64 encode addresses |
| 19 |
| 20 Base64 encode sensitive `href` addresses into `data-address` attributes. |
| 21 |
| 22 #### Markdown (before processing) |
| 23 |
| 24 ``` |
| 25 [Private Email](#){: data-address="bWFpbHRvOnVzZXJuYW1lQGV4YW1wbGUuY29t" } |
| 26 ``` |
| 27 |
| 28 #### HTML (before processing) |
| 29 |
| 30 ``` |
| 31 <a data-address="bWFpbHRvOnVzZXJuYW1lQGV4YW1wbGUuY29t">Private Email</a> |
| 32 ``` |
| 33 |
| 34 #### Output (after processing) |
| 35 |
| 36 ``` |
| 37 <a href="mailto:username@example.com">Private Email</a> |
| 38 ``` |
| 39 |
| 40 ## Example |
| 41 |
| 42 <script src="/js/address-masking.js"></script> |
| 43 |
| 44 <a data-address="bWFpbHRvOnVzZXJuYW1lQGV4YW1wbGUuY29t">Private Email</a> |
OLD | NEW |