markdown-formatter
markdown-formatter copied to clipboard
Autoformat incorrectly adding spaces in code fence
Before formatting:
After formatting:
The code block must have an explicit life language type, like
``` python
output = check_age('Adrian',22)
print(output)
```
- You've missed the point. Notice in the first screenshot, there is no trailing whitespace after the codefence for the unhighlighted and Python code blocks both. The autoformatter added whitespace in the second screenshot.
- There are plenty of times where you would want to use a plain code block without syntax highlighting.
@sumnow Can we reopen this issue? The problem is that markdown code like this:
``` python
print(5)
```
Should be formatted like this
```python
print(5)
```
That is, there should not be a space between the three backticks and the language type. It should be ```python
instead of ``` python
. See the examples in the Mastering Markdown article. This autoformatter is adding whitespace that shouldn't be there.