Skip to content

Commit

Permalink
Add tip to avoid trailing whitespace (#1875)
Browse files Browse the repository at this point in the history
* Add tip to avoid trailing whitespace

Because a whitespace is required for fenced code blocks on the first line of a list item, it's a better practice to include an explicit whitespace so it does not get accidentally removed. (Using   does not have the same effect because that character gets parsed into the HTML as a character string so you end up with a blank line before the code block, whereas the unicode space gets collapsed and ignored by the Markdown parser.)

* Revise explanation of unicode space for clarity
  • Loading branch information
scottamain committed Dec 9, 2022
1 parent 06ac495 commit b784547
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions docs/src/markdown/extensions/superfences.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,17 @@ md = markdown.Markdown(extensions=['pymdownx.superfences'])
````

7. If using a fenced block as the first line of a list, you will have to leave the first line blank, but remember that
the list marker must be followed by a space.
the list marker must be immediately followed by at least one space. To avoid accidentally deleting the space and to
make your intentions clear, you might want to also add an explicit unicode space (` `) as shown here:

````
-<space>
- &#32;
```
a fenced block
```

Definition
:<space>
: &#32;
```
a fenced block
```
Expand Down

0 comments on commit b784547

Please sign in to comment.