-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
👌 Remove hard-coded block indent limit
For CommonMark, the presence of indented code blocks prevent any other block element from having an indent of greater than 4 spaces. Certain Markdown flavors and derivatives, such as mdx and djot, disable these code blocks though, since it is more common to use code fences and indenting is desirable. Currently, disabling code blocks does not remove the indent limitation, since most block elements have the 3 space limitation hard-coded. This commit therefore centralises the logic of applying this limitation, and only applies it when indented code blocks are enabled. Note, this is a potential breaking change and divergence from upstream markdown-it, for this niche case, but I feel makes sense.
- Loading branch information
1 parent
83d66d4
commit b96bd39
Showing
13 changed files
with
104 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
indent paragraph | ||
. | ||
This is a paragraph, | ||
with multiple lines. | ||
|
||
This paragraph | ||
has variable indents, | ||
like this. | ||
. | ||
<p>This is a paragraph, | ||
with multiple lines.</p> | ||
<p>This paragraph | ||
has variable indents, | ||
like this.</p> | ||
. | ||
|
||
indent in HTML | ||
. | ||
<div> | ||
|
||
Paragraph | ||
|
||
</div> | ||
. | ||
<div> | ||
<p>Paragraph</p> | ||
</div> | ||
. | ||
|
||
indent fence | ||
. | ||
```python | ||
def foo(): | ||
pass | ||
``` | ||
. | ||
<pre><code class="language-python">def foo(): | ||
pass | ||
</code></pre> | ||
. | ||
|
||
indent heading | ||
. | ||
# Heading | ||
. | ||
<h1>Heading</h1> | ||
. | ||
|
||
indent table | ||
. | ||
| foo | bar | | ||
| --- | --- | | ||
| baz | bim | | ||
. | ||
<table> | ||
<thead> | ||
<tr> | ||
<th>foo</th> | ||
<th>bar</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td>baz</td> | ||
<td>bim</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters