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: Created May 25, 2018, 7:34 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,41 @@
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" }'
ire 2018/05/25 07:35:05 This requires that we use a single quote for the o
juliandoucette 2018/05/25 08:50:59 You mean we can't just escape or flip the quotes t
ire 2018/05/25 09:02:10 No we can't. I will add that.
+
+[#](#){: data-mask='{ "href": "bWFpbHRvOnVzZXJuYW1lQGV4YW1wbGUuY29t", "textContent": "dXNlcm5hbWVAZXhhbXBsZS5jb20=" }'
juliandoucette 2018/05/25 08:50:59 TOL: Seems like we could make this friendlier than
ire 2018/05/25 09:02:10 Changed to "email"
```
#### 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=" }'>#</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=" }'>#</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