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

Unified 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.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | static/js/address-masking.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pages/address-masking.md
===================================================================
--- a/pages/address-masking.md
+++ b/pages/address-masking.md
@@ -12,33 +12,43 @@
Include the following script at the bottom of a page:
```
<script src="/js/address-masking.js"></script>
```
### Step 2: Base64 encode addresses
-Base64 encode sensitive `href` addresses into `data-address` attributes.
+Base64 encode sensitive `href` addresses into `data-mask` attributes.
#### Markdown (before processing)
```
-[Private Email](#){: data-address="bWFpbHRvOnVzZXJuYW1lQGV4YW1wbGUuY29t" }
+[Private Email](#){: data-mask='{ "href": "bWFpbHRvOnVzZXJuYW1lQGV4YW1wbGUuY29t" }'
+
+[Email](#){: data-mask='{ "href": "bWFpbHRvOnVzZXJuYW1lQGV4YW1wbGUuY29t", "textContent": "dXNlcm5hbWVAZXhhbXBsZS5jb20=" }'
```
+Note that you are required to use single quotes `'` for the `data-mask` attribute and double quotes `"` for the keys and values in the object.
+
#### HTML (before processing)
```
-<a data-address="bWFpbHRvOnVzZXJuYW1lQGV4YW1wbGUuY29t">Private Email</a>
+<a data-mask='{ "href": "bWFpbHRvOnVzZXJuYW1lQGV4YW1wbGUuY29t" }'>Private Email</a>
+
+<a data-mask='{ "href": "bWFpbHRvOnVzZXJuYW1lQGV4YW1wbGUuY29t", "textContent": "dXNlcm5hbWVAZXhhbXBsZS5jb20=" }'>Email</a>
```
#### Output (after processing)
```
<a href="mailto:username@example.com">Private Email</a>
+
+<a href="mailto:username@example.com">username@example.com</a>
```
## Example
<script src="/js/address-masking.js"></script>
-<a data-address="bWFpbHRvOnVzZXJuYW1lQGV4YW1wbGUuY29t">Private Email</a>
+<a data-mask='{ "href": "bWFpbHRvOnVzZXJuYW1lQGV4YW1wbGUuY29t" }'>Private Email</a>
+
+<a data-mask='{ "href": "bWFpbHRvOnVzZXJuYW1lQGV4YW1wbGUuY29t", "textContent": "dXNlcm5hbWVAZXhhbXBsZS5jb20=" }'>Email</a>
« 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