Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: pages/address-masking.md

Issue 29790573: Fixes #6 - Extend address masking to mask other attributes (Closed) Base URL: https://hg.adblockplus.org/website-defaults
Patch Set: Addressed NITs Created May 25, 2018, 9:01 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | static/js/address-masking.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 title=Address Masking 1 title=Address Masking
2 description=Use address masking to avoid spam. 2 description=Use address masking to avoid spam.
3 3
4 # Address masking 4 # Address masking
5 5
6 Use address masking to avoid spam. 6 Use address masking to avoid spam.
7 7
8 ## Usage 8 ## Usage
9 9
10 ### Step 1: Include script on page 10 ### Step 1: Include script on page
11 11
12 Include the following script at the bottom of a page: 12 Include the following script at the bottom of a page:
13 13
14 ``` 14 ```
15 <script src="/js/address-masking.js"></script> 15 <script src="/js/address-masking.js"></script>
16 ``` 16 ```
17 17
18 ### Step 2: Base64 encode addresses 18 ### Step 2: Base64 encode addresses
19 19
20 Base64 encode sensitive `href` addresses into `data-address` attributes. 20 Base64 encode sensitive `href` addresses into `data-mask` attributes.
21 21
22 #### Markdown (before processing) 22 #### Markdown (before processing)
23 23
24 ``` 24 ```
25 [Private Email](#){: data-address="bWFpbHRvOnVzZXJuYW1lQGV4YW1wbGUuY29t" } 25 [Private Email](#){: data-mask='{ "href": "bWFpbHRvOnVzZXJuYW1lQGV4YW1wbGUuY29t" }'
26
27 [Email](#){: data-mask='{ "href": "bWFpbHRvOnVzZXJuYW1lQGV4YW1wbGUuY29t", "textC ontent": "dXNlcm5hbWVAZXhhbXBsZS5jb20=" }'
26 ``` 28 ```
27 29
30 Note that you are required to use single quotes `'` for the `data-mask` attribut e and double quotes `"` for the keys and values in the object.
31
28 #### HTML (before processing) 32 #### HTML (before processing)
29 33
30 ``` 34 ```
31 <a data-address="bWFpbHRvOnVzZXJuYW1lQGV4YW1wbGUuY29t">Private Email</a> 35 <a data-mask='{ "href": "bWFpbHRvOnVzZXJuYW1lQGV4YW1wbGUuY29t" }'>Private Email< /a>
36
37 <a data-mask='{ "href": "bWFpbHRvOnVzZXJuYW1lQGV4YW1wbGUuY29t", "textContent": " dXNlcm5hbWVAZXhhbXBsZS5jb20=" }'>Email</a>
32 ``` 38 ```
33 39
34 #### Output (after processing) 40 #### Output (after processing)
35 41
36 ``` 42 ```
37 <a href="mailto:username@example.com">Private Email</a> 43 <a href="mailto:username@example.com">Private Email</a>
44
45 <a href="mailto:username@example.com">username@example.com</a>
38 ``` 46 ```
39 47
40 ## Example 48 ## Example
41 49
42 <script src="/js/address-masking.js"></script> 50 <script src="/js/address-masking.js"></script>
43 51
44 <a data-address="bWFpbHRvOnVzZXJuYW1lQGV4YW1wbGUuY29t">Private Email</a> 52 <a data-mask='{ "href": "bWFpbHRvOnVzZXJuYW1lQGV4YW1wbGUuY29t" }'>Private Email< /a>
53
54 <a data-mask='{ "href": "bWFpbHRvOnVzZXJuYW1lQGV4YW1wbGUuY29t", "textContent": " dXNlcm5hbWVAZXhhbXBsZS5jb20=" }'>Email</a>
OLDNEW
« no previous file with comments | « no previous file | static/js/address-masking.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld