Skip to content

Commit 6b6357c

Browse files
committed
Update link best practices section
1 parent ce05be7 commit 6b6357c

File tree

2 files changed

+31
-4
lines changed

2 files changed

+31
-4
lines changed

_basic-syntax/links.md

+30-3
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ and the HTML for the link would be:
140140

141141
### Link Best Practices
142142

143-
Markdown applications don't agree on how to handle spaces in the middle of a URL. For compatibility, try to URL encode any spaces with `%20`. Alternatively, if your Markdown application [supports HTML](#html), you could use the `a` HTML tag.
143+
Markdown applications don't agree on how to handle spaces or parentheses in the middle of a URL. For compatibility, try to URL encode any spaces with `%20`. Alternatively, if your Markdown application [supports HTML](#html), you could use the `a` HTML tag.
144144

145145
<table class="table table-bordered">
146146
<thead class="thead-light">
@@ -155,12 +155,39 @@ Markdown applications don't agree on how to handle spaces in the middle of a URL
155155
<code class="highlighter-rouge">
156156
[link](https://www.example.com/my%20great%20page)<br><br>
157157

158-
&lt;a href="https://www.example.com/my great page"&gt;link&lt;/a&gt;
158+
&lt;a href="https://www.example.com/my great page"&gt;link&lt;/a&gt;<br><br>
159159
</code>
160160
</td>
161161
<td>
162162
<code class="highlighter-rouge">
163-
[link](https://www.example.com/my great page)
163+
[link](https://www.example.com/my great page)<br><br>
164+
</code>
165+
</td>
166+
</tr>
167+
</tbody>
168+
</table>
169+
170+
Parentheses in the middle of a URL can also be problematic. For compatibility, try to URL encode the opening parenthesis (`(`) with `%28` and the closing parenthesis (`)`) with `%29`. Alternatively, if your Markdown application [supports HTML](#html), you could use the `a` HTML tag.
171+
172+
<table class="table table-bordered">
173+
<thead class="thead-light">
174+
<tr>
175+
<th>✅&nbsp; Do this</th>
176+
<th>❌&nbsp; Don't do this</th>
177+
</tr>
178+
</thead>
179+
<tbody>
180+
<tr>
181+
<td>
182+
<code class="highlighter-rouge">
183+
[a novel](https://en.wikipedia.org/wiki/The_Milagro_Beanfield_War_%28novel%29)<br><br>
184+
185+
&lt;a href="https://en.wikipedia.org/wiki/The_Milagro_Beanfield_War_(novel)"&gt;a novel&lt;/a&gt;<br><br>
186+
</code>
187+
</td>
188+
<td>
189+
<code class="highlighter-rouge">
190+
[a novel](https://en.wikipedia.org/wiki/The_Milagro_Beanfield_War_(novel))
164191
</code>
165192
</td>
166193
</tr>

basic-syntax.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
layout: default
33
title: Basic Syntax
44
description: The Markdown elements outlined in the original design document.
5-
last_modified_at: 2022-04-08
5+
last_modified_at: 2023-04-22
66
---
77

88
{% include syntax.html type="basic" syntax-id="overview" %}

0 commit comments

Comments
 (0)