Add regression tests for Markdown (#19335)
This commit is contained in:
1 parent
a9bbb507d1
commit
2680e80adb
22 files changed
+450
-7
No files matched your search
@@ -32,6 +32,103 @@ _bug_?
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`issue-3837.md - {"proseWrap":"always"} format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["markdown"]
|
||||
proseWrap: "always"
|
||||
printWidth: 80 (default) |
|
||||
=====================================input======================================
|
||||
5 * 10
|
||||
a * b * c
|
||||
|
||||
=====================================output=====================================
|
||||
5 * 10 a * b * c
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`issue-6112.md - {"proseWrap":"always"} format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["markdown"]
|
||||
proseWrap: "always"
|
||||
printWidth: 80 (default) |
|
||||
=====================================input======================================
|
||||
*[Italic link](../_link_including_underscores_.md)*
|
||||
|
||||
---
|
||||
|
||||
_[Italic link](../_link_including_underscores_.md)_
|
||||
|
||||
=====================================output=====================================
|
||||
_[Italic link](../_link_including_underscores_.md)_
|
||||
|
||||
---
|
||||
|
||||
_[Italic link](../_link_including_underscores_.md)_
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`issue-15032.md - {"proseWrap":"always"} format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["markdown"]
|
||||
proseWrap: "always"
|
||||
printWidth: 80 (default) |
|
||||
=====================================input======================================
|
||||
1: The **exponentiation (\`**\`)** operator.
|
||||
|
||||
2: The *exponentiation (\`*\`)* operator.
|
||||
|
||||
3: The _exponentiation (\`_\`)_ operator.
|
||||
|
||||
4: The __exponentiation (\`__\`)__ operator.
|
||||
|
||||
=====================================output=====================================
|
||||
1: The **exponentiation (\`**\`)** operator.
|
||||
|
||||
2: The _exponentiation (\`*\`)_ operator.
|
||||
|
||||
3: The _exponentiation (\`_\`)_ operator.
|
||||
|
||||
4: The **exponentiation (\`__\`)** operator.
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`issue-16160.md - {"proseWrap":"always"} format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["markdown"]
|
||||
proseWrap: "always"
|
||||
printWidth: 80 (default) |
|
||||
=====================================input======================================
|
||||
- style\\_name = *dplr*
|
||||
- style\\_name = _dplr_
|
||||
- style_name = _dplr_
|
||||
|
||||
=====================================output=====================================
|
||||
- style\\_name = _dplr_
|
||||
- style\\_name = _dplr_
|
||||
- style_name = _dplr_
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`issue-17286.md - {"proseWrap":"always"} format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["markdown"]
|
||||
proseWrap: "always"
|
||||
printWidth: 80 (default) |
|
||||
=====================================input======================================
|
||||
Note: With {"NO\\_PROPAGATE"}, the client is expected to honour the {"errors"} in
|
||||
the _response_ and prevent developers from reading a \`null\` produced by an
|
||||
|
||||
=====================================output=====================================
|
||||
Note: With {"NO\\_PROPAGATE"}, the client is expected to honour the {"errors"} in
|
||||
the _response_ and prevent developers from reading a \`null\` produced by an
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`nbsp.md - {"proseWrap":"always"} format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["markdown"]
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
1: The **exponentiation (`**`)** operator.
|
||||
|
||||
2: The *exponentiation (`*`)* operator.
|
||||
|
||||
3: The _exponentiation (`_`)_ operator.
|
||||
|
||||
4: The __exponentiation (`__`)__ operator.
|
||||
@@ -0,0 +1,3 @@
|
||||
- style\_name = *dplr*
|
||||
- style\_name = _dplr_
|
||||
- style_name = _dplr_
|
||||
@@ -0,0 +1,2 @@
|
||||
Note: With {"NO\_PROPAGATE"}, the client is expected to honour the {"errors"} in
|
||||
the _response_ and prevent developers from reading a `null` produced by an
|
||||
@@ -0,0 +1,2 @@
|
||||
5 * 10
|
||||
a * b * c
|
||||
@@ -0,0 +1,5 @@
|
||||
*[Italic link](../_link_including_underscores_.md)*
|
||||
|
||||
---
|
||||
|
||||
_[Italic link](../_link_including_underscores_.md)_
|
||||
@@ -1,5 +1,46 @@
|
||||
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
||||
|
||||
exports[`issue-17300.md format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["markdown"]
|
||||
printWidth: 80 (default) |
|
||||
=====================================input======================================
|
||||
> [NOTE]
|
||||
> [Link](https://example.com) after link reference.
|
||||
>
|
||||
> [IMPORTANT]
|
||||
> **Strong emphasis** after link reference.
|
||||
|
||||
> [CRITICAL]
|
||||
> _emphasis_ oafter link reference
|
||||
|
||||
> **Strong emphasis**
|
||||
> _emphasis_
|
||||
|
||||
[NOTE]: /note
|
||||
[IMPORTANT]: /important
|
||||
[CRITICAL]: /critical
|
||||
|
||||
=====================================output=====================================
|
||||
> [NOTE]
|
||||
> [Link](https://example.com) after link reference.
|
||||
>
|
||||
> [IMPORTANT]
|
||||
> **Strong emphasis** after link reference.
|
||||
|
||||
> [CRITICAL]
|
||||
> _emphasis_ oafter link reference
|
||||
|
||||
> **Strong emphasis**
|
||||
> _emphasis_
|
||||
|
||||
[NOTE]: /note
|
||||
[IMPORTANT]: /important
|
||||
[CRITICAL]: /critical
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`snippet: #0 format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["markdown"]
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
> [NOTE]
|
||||
> [Link](https://example.com) after link reference.
|
||||
>
|
||||
> [IMPORTANT]
|
||||
> **Strong emphasis** after link reference.
|
||||
|
||||
> [CRITICAL]
|
||||
> _emphasis_ oafter link reference
|
||||
|
||||
> **Strong emphasis**
|
||||
> _emphasis_
|
||||
|
||||
[NOTE]: /note
|
||||
[IMPORTANT]: /important
|
||||
[CRITICAL]: /critical
|
||||
+3
-7
@@ -1,19 +1,15 @@
|
||||
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
||||
|
||||
exports[`issue-19146.md - {"proseWrap":"always"} format 1`] = `
|
||||
exports[`issue-6078.md - {"proseWrap":"always"} format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["markdown"]
|
||||
proseWrap: "always"
|
||||
printWidth: 80 (default) |
|
||||
=====================================input======================================
|
||||
- foo
|
||||
- bar
|
||||
- baz
|
||||
[](http://example.com/path?a=1&b=2&c=3)
|
||||
|
||||
=====================================output=====================================
|
||||
- foo
|
||||
- bar
|
||||
- baz
|
||||
[](http://example.com/path?a=1&b=2&c=3)
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
File renamed without changes.
@@ -0,0 +1 @@
|
||||
[](http://example.com/path?a=1&b=2&c=3)
|
||||
@@ -0,0 +1,190 @@
|
||||
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
||||
|
||||
exports[`issue-7474.md - {"proseWrap":"always"} format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["markdown"]
|
||||
proseWrap: "always"
|
||||
printWidth: 80 (default) |
|
||||
=====================================input======================================
|
||||
1. - XXX
|
||||
- XXX
|
||||
2. XXX
|
||||
|
||||
=====================================output=====================================
|
||||
1. - XXX
|
||||
- XXX
|
||||
2. XXX
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`issue-10063.md - {"proseWrap":"always"} format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["markdown"]
|
||||
proseWrap: "always"
|
||||
printWidth: 80 (default) |
|
||||
=====================================input======================================
|
||||
# Example 1 (compact list with code block)
|
||||
|
||||
- Sibling item before
|
||||
- A bullet point with bare text (not in a \`<p>\`), followed by a code block that includes an empty line
|
||||
\`\`\`javascript
|
||||
const foo = "bar";
|
||||
|
||||
console.log(foo);
|
||||
\`\`\`
|
||||
- Sibling item after
|
||||
|
||||
# Example 2 (compact nested list with code block)
|
||||
|
||||
- Parent bullet point which is not wrapped in \`<p>\`
|
||||
- Sibling item before
|
||||
- Item containing a code block that includes an empty line
|
||||
\`\`\`javascript
|
||||
const foo = "bar";
|
||||
|
||||
console.log(foo);
|
||||
\`\`\`
|
||||
- Sibling item after
|
||||
|
||||
# Example 3 (like example 2, but doesn't trigger the bug)
|
||||
|
||||
- It works as expected
|
||||
- If the code block
|
||||
- Does not have a line break
|
||||
\`\`\`javascript
|
||||
const foo = "bar";
|
||||
console.log(foo);
|
||||
\`\`\`
|
||||
- It doesn't affect other items
|
||||
|
||||
=====================================output=====================================
|
||||
# Example 1 (compact list with code block)
|
||||
|
||||
- Sibling item before
|
||||
- A bullet point with bare text (not in a \`<p>\`), followed by a code block that
|
||||
includes an empty line
|
||||
\`\`\`javascript
|
||||
const foo = "bar";
|
||||
|
||||
console.log(foo);
|
||||
\`\`\`
|
||||
- Sibling item after
|
||||
|
||||
# Example 2 (compact nested list with code block)
|
||||
|
||||
- Parent bullet point which is not wrapped in \`<p>\`
|
||||
- Sibling item before
|
||||
- Item containing a code block that includes an empty line
|
||||
\`\`\`javascript
|
||||
const foo = "bar";
|
||||
|
||||
console.log(foo);
|
||||
\`\`\`
|
||||
- Sibling item after
|
||||
|
||||
# Example 3 (like example 2, but doesn't trigger the bug)
|
||||
|
||||
- It works as expected
|
||||
- If the code block
|
||||
- Does not have a line break
|
||||
\`\`\`javascript
|
||||
const foo = "bar";
|
||||
console.log(foo);
|
||||
\`\`\`
|
||||
- It doesn't affect other items
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`issue-11202.md - {"proseWrap":"always"} format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["markdown"]
|
||||
proseWrap: "always"
|
||||
printWidth: 80 (default) |
|
||||
=====================================input======================================
|
||||
\`\`\`markdown
|
||||
<!-- comment -->
|
||||
<!-- another comment -->
|
||||
-
|
||||
-
|
||||
-
|
||||
\`\`\`
|
||||
|
||||
|
||||
=====================================output=====================================
|
||||
\`\`\`markdown
|
||||
<!-- comment -->
|
||||
<!-- another comment -->
|
||||
|
||||
-
|
||||
-
|
||||
-
|
||||
\`\`\`
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`issue-12677.md - {"proseWrap":"always"} format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["markdown"]
|
||||
proseWrap: "always"
|
||||
printWidth: 80 (default) |
|
||||
=====================================input======================================
|
||||
5.1 **Section 1**
|
||||
|
||||
- apple
|
||||
- banana
|
||||
- cherry
|
||||
|
||||
5.2 **Section 2**
|
||||
|
||||
Why is this section indented?
|
||||
|
||||
=====================================output=====================================
|
||||
5.1 **Section 1**
|
||||
|
||||
- apple
|
||||
- banana
|
||||
- cherry
|
||||
|
||||
5.2 **Section 2**
|
||||
|
||||
Why is this section indented?
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`issue-19146.md - {"proseWrap":"always"} format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["markdown"]
|
||||
proseWrap: "always"
|
||||
printWidth: 80 (default) |
|
||||
=====================================input======================================
|
||||
- foo
|
||||
- bar
|
||||
- baz
|
||||
|
||||
=====================================output=====================================
|
||||
- foo
|
||||
- bar
|
||||
- baz
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`issue-19152.md - {"proseWrap":"always"} format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["markdown"]
|
||||
proseWrap: "always"
|
||||
printWidth: 80 (default) |
|
||||
=====================================input======================================
|
||||
- foo
|
||||
- foo
|
||||
|
||||
=====================================output=====================================
|
||||
- foo
|
||||
- foo
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
@@ -0,0 +1 @@
|
||||
runFormatTest(import.meta, ["markdown"], { proseWrap: "always" });
|
||||
@@ -0,0 +1,33 @@
|
||||
# Example 1 (compact list with code block)
|
||||
|
||||
- Sibling item before
|
||||
- A bullet point with bare text (not in a `<p>`), followed by a code block that includes an empty line
|
||||
```javascript
|
||||
const foo = "bar";
|
||||
|
||||
console.log(foo);
|
||||
```
|
||||
- Sibling item after
|
||||
|
||||
# Example 2 (compact nested list with code block)
|
||||
|
||||
- Parent bullet point which is not wrapped in `<p>`
|
||||
- Sibling item before
|
||||
- Item containing a code block that includes an empty line
|
||||
```javascript
|
||||
const foo = "bar";
|
||||
|
||||
console.log(foo);
|
||||
```
|
||||
- Sibling item after
|
||||
|
||||
# Example 3 (like example 2, but doesn't trigger the bug)
|
||||
|
||||
- It works as expected
|
||||
- If the code block
|
||||
- Does not have a line break
|
||||
```javascript
|
||||
const foo = "bar";
|
||||
console.log(foo);
|
||||
```
|
||||
- It doesn't affect other items
|
||||
@@ -0,0 +1,8 @@
|
||||
```markdown
|
||||
<!-- comment -->
|
||||
<!-- another comment -->
|
||||
-
|
||||
-
|
||||
-
|
||||
```
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
5.1 **Section 1**
|
||||
|
||||
- apple
|
||||
- banana
|
||||
- cherry
|
||||
|
||||
5.2 **Section 2**
|
||||
|
||||
Why is this section indented?
|
||||
File renamed without changes.
@@ -0,0 +1,2 @@
|
||||
- foo
|
||||
- foo
|
||||
@@ -0,0 +1,3 @@
|
||||
1. - XXX
|
||||
- XXX
|
||||
2. XXX
|
||||
@@ -40,6 +40,32 @@ $$
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`issue-12793.md format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["markdown"]
|
||||
printWidth: 80 (default) |
|
||||
=====================================input======================================
|
||||
$ P\\Big(\\mathop{\\cup}\\limits^n_{i=1}A_i\\Big) = \\sum\\limits^n_{i=1}P(A_i) $
|
||||
|
||||
=====================================output=====================================
|
||||
$ P\\Big(\\mathop{\\cup}\\limits^n_{i=1}A_i\\Big) = \\sum\\limits^n_{i=1}P(A_i) $
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`issue-16664.md format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["markdown"]
|
||||
printWidth: 80 (default) |
|
||||
=====================================input======================================
|
||||
$$ \\textrm{p-value} = 1 - \\sum_{x \\leq a} H(x | N, r_1, m_1) $$
|
||||
|
||||
=====================================output=====================================
|
||||
$$ \\textrm{p-value} = 1 - \\sum_{x \\leq a} H(x | N, r_1, m_1) $$
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`math-like.md format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["markdown"]
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
$ P\Big(\mathop{\cup}\limits^n_{i=1}A_i\Big) = \sum\limits^n_{i=1}P(A_i) $
|
||||
@@ -0,0 +1 @@
|
||||
$$ \textrm{p-value} = 1 - \sum_{x \leq a} H(x | N, r_1, m_1) $$
|
||||
Reference in new issue
Block a user