Skip to content

Commit 20525e0

Browse files
authored
Add %20 for spaces in mailto link
Use %20 for the space character to be more sure that different email clients will interpret this when opening the mailto link. Added to code block and brief explanation below for why to use it (could be rephrased if necessary).
1 parent b525f36 commit 20525e0

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

html/lesson1/tutorial.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,10 +297,10 @@ Links can also open up a user's email client and share content. The difference b
297297
```html
298298
<ul>
299299
<li>
300-
<a href="mailto:[email protected]?subject=I love owls :: codebar">Email us</a>
300+
<a href="mailto:[email protected]?subject=I%20love%20owls%20::%20codebar">Email us</a>
301301
</li>
302302
<li>
303-
<a href="mailto:?subject=I love owls :: codebar">Email a friend</a>
303+
<a href="mailto:?subject=I%20love%20owls%20::%20codebar">Email a friend</a>
304304
</li>
305305
</ul>
306306
```
@@ -309,7 +309,9 @@ Links can also open up a user's email client and share content. The difference b
309309
310310
> What happens when you click the second link? How is it different?
311311
312-
> What happens when you add `&body=Owls are amazing` to the second link?
312+
> What happens when you add `&body=Owls%20are%20amazing` to the second link?
313+
314+
Note that replacing spaces in the subject text with **%20** isn't essential but makes sure the spaces are kept when opening the link in a range of both new and older email clients/software.
313315

314316
### Commenting
315317

0 commit comments

Comments
 (0)