mirror of
https://github.com/oxc-project/oxc.git
synced 2026-11-04 10:29:58 +00:00
docs(formatter_markdown): record unclosed fences closing at a directive's closer (#27279)
This commit is contained in:
1 parent
2445064092
commit
656b81cce4
3 files changed
+65
No files matched your search
@@ -301,6 +301,9 @@ Prettier has no directive construct (#19662 would add micromark's grammar only),
|
||||
An opener interrupts a paragraph (as in micromark's directive extension and markdown-it-container),
|
||||
so like any block it is printed after a blank line, under `preserve` too; Prettier keeps it on the paragraph's next line.
|
||||
|
||||
A fence left open inside a directive closes at the directive's closer (as in micromark's directive extension and markdown-it-container),
|
||||
so the closing fence is printed explicitly: a reader without directives (CommonMark, GitHub) reads the open fence on to the next closing run, and sees the output's tree change.
|
||||
|
||||
## line-shapes
|
||||
|
||||
- Why: semantics
|
||||
|
||||
+7
@@ -24,3 +24,10 @@ A paragraph right before an opener:
|
||||
:::note
|
||||
The opener interrupts it, so a blank line separates them.
|
||||
:::
|
||||
|
||||
<!-- A fence left open inside a directive closes at its closer, printed explicitly -->
|
||||
|
||||
::: code-group
|
||||
````js
|
||||
a
|
||||
:::
|
||||
Vendored
+55
@@ -29,6 +29,13 @@ A paragraph right before an opener:
|
||||
The opener interrupts it, so a blank line separates them.
|
||||
:::
|
||||
|
||||
<!-- A fence left open inside a directive closes at its closer, printed explicitly -->
|
||||
|
||||
::: code-group
|
||||
````js
|
||||
a
|
||||
:::
|
||||
|
||||
==================== Output ====================
|
||||
---------------------------------------
|
||||
{ printWidth: 80, proseWrap: "always" }
|
||||
@@ -61,6 +68,14 @@ A paragraph right before an opener:
|
||||
The opener interrupts it, so a blank line separates them.
|
||||
:::
|
||||
|
||||
<!-- A fence left open inside a directive closes at its closer, printed explicitly -->
|
||||
|
||||
::: code-group
|
||||
```js
|
||||
a
|
||||
```
|
||||
:::
|
||||
|
||||
----------------------------------------
|
||||
{ printWidth: 100, proseWrap: "always" }
|
||||
----------------------------------------
|
||||
@@ -90,6 +105,14 @@ A paragraph right before an opener:
|
||||
The opener interrupts it, so a blank line separates them.
|
||||
:::
|
||||
|
||||
<!-- A fence left open inside a directive closes at its closer, printed explicitly -->
|
||||
|
||||
::: code-group
|
||||
```js
|
||||
a
|
||||
```
|
||||
:::
|
||||
|
||||
--------------------------------------
|
||||
{ printWidth: 80, proseWrap: "never" }
|
||||
--------------------------------------
|
||||
@@ -119,6 +142,14 @@ A paragraph right before an opener:
|
||||
The opener interrupts it, so a blank line separates them.
|
||||
:::
|
||||
|
||||
<!-- A fence left open inside a directive closes at its closer, printed explicitly -->
|
||||
|
||||
::: code-group
|
||||
```js
|
||||
a
|
||||
```
|
||||
:::
|
||||
|
||||
---------------------------------------
|
||||
{ printWidth: 100, proseWrap: "never" }
|
||||
---------------------------------------
|
||||
@@ -148,6 +179,14 @@ A paragraph right before an opener:
|
||||
The opener interrupts it, so a blank line separates them.
|
||||
:::
|
||||
|
||||
<!-- A fence left open inside a directive closes at its closer, printed explicitly -->
|
||||
|
||||
::: code-group
|
||||
```js
|
||||
a
|
||||
```
|
||||
:::
|
||||
|
||||
-----------------------------------------
|
||||
{ printWidth: 80, proseWrap: "preserve" }
|
||||
-----------------------------------------
|
||||
@@ -179,6 +218,14 @@ A paragraph right before an opener:
|
||||
The opener interrupts it, so a blank line separates them.
|
||||
:::
|
||||
|
||||
<!-- A fence left open inside a directive closes at its closer, printed explicitly -->
|
||||
|
||||
::: code-group
|
||||
```js
|
||||
a
|
||||
```
|
||||
:::
|
||||
|
||||
------------------------------------------
|
||||
{ printWidth: 100, proseWrap: "preserve" }
|
||||
------------------------------------------
|
||||
@@ -210,4 +257,12 @@ A paragraph right before an opener:
|
||||
The opener interrupts it, so a blank line separates them.
|
||||
:::
|
||||
|
||||
<!-- A fence left open inside a directive closes at its closer, printed explicitly -->
|
||||
|
||||
::: code-group
|
||||
```js
|
||||
a
|
||||
```
|
||||
:::
|
||||
|
||||
===================== End =====================
|
||||
Reference in new issue
Block a user