Skip to content

Commit 7b14e2e

Browse files
authored
Merge pull request #867 from MihaZupan/commonmark-0.31.2
Update to CommonMark 0.31.2
2 parents 1e17dcd + 42ab989 commit 7b14e2e

File tree

13 files changed

+1224
-1070
lines changed

13 files changed

+1224
-1070
lines changed

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ You can **try Markdig online** and compare it to other implementations on [babel
1414
- **Abstract Syntax Tree** with precise source code location for syntax tree, useful when building a Markdown editor.
1515
- Checkout [Markdown Editor v2 for Visual Studio 2022](https://marketplace.visualstudio.com/items?itemName=MadsKristensen.MarkdownEditor2) powered by Markdig!
1616
- Converter to **HTML**
17-
- Passing more than **600+ tests** from the latest [CommonMark specs (0.30)](http://spec.commonmark.org/)
17+
- Passing more than **600+ tests** from the latest [CommonMark specs (0.31.2)](http://spec.commonmark.org/)
1818
- Includes all the core elements of CommonMark:
1919
- including **GFM fenced code blocks**.
2020
- **Extensible** architecture

src/Markdig.Tests/Specs/AutoLinks.generated.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,5 +533,28 @@ public void ExtensionsAutoLinksUnicodeSupport_Example025()
533533

534534
TestParser.TestSpec("<http://foö.bar.`baz>`", "<p><a href=\"http://xn--fo-gka.bar.%60baz\">http://foö.bar.`baz</a>`</p>", "autolinks|advanced", context: "Example 25\nSection Extensions / AutoLinks / Unicode support\n");
535535
}
536+
537+
// Unicode punctuation characters are not allowed, but symbols are.
538+
// Note that this does _not_ exactly match CommonMark's "Unicode punctuation character" definition.
539+
[Test]
540+
public void ExtensionsAutoLinksUnicodeSupport_Example026()
541+
{
542+
// Example 26
543+
// Section: Extensions / AutoLinks / Unicode support
544+
//
545+
// The following Markdown:
546+
// http://☃.net?☃ // OtherSymbol
547+
//
548+
// http://🍉.net?🍉 // A UTF-16 surrogate pair, but code point is OtherSymbol
549+
//
550+
// http://‰.net?‰ // OtherPunctuation
551+
//
552+
// Should be rendered as:
553+
// <p><a href="http://xn--n3h.net?%E2%98%83">http://☃.net?☃</a> // OtherSymbol</p>
554+
// <p><a href="http://xn--ji8h.net?%F0%9F%8D%89">http://🍉.net?🍉</a> // A UTF-16 surrogate pair, but code point is OtherSymbol</p>
555+
// <p>http://‰.net?‰ // OtherPunctuation</p>
556+
557+
TestParser.TestSpec("http://☃.net?☃ // OtherSymbol\n\nhttp://🍉.net?🍉 // A UTF-16 surrogate pair, but code point is OtherSymbol\n\nhttp://‰.net?‰ // OtherPunctuation", "<p><a href=\"http://xn--n3h.net?%E2%98%83\">http://☃.net?☃</a> // OtherSymbol</p>\n<p><a href=\"http://xn--ji8h.net?%F0%9F%8D%89\">http://🍉.net?🍉</a> // A UTF-16 surrogate pair, but code point is OtherSymbol</p>\n<p>http://‰.net?‰ // OtherPunctuation</p>", "autolinks|advanced", context: "Example 26\nSection Extensions / AutoLinks / Unicode support\n");
558+
}
536559
}
537560
}

src/Markdig.Tests/Specs/AutoLinks.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,4 +303,19 @@ This will therefore be seen as an autolink and not as code inline.
303303
<http://foö.bar.`baz>`
304304
.
305305
<p><a href="http://xn--fo-gka.bar.%60baz">http://foö.bar.`baz</a>`</p>
306+
````````````````````````````````
307+
308+
Unicode punctuation characters are not allowed, but symbols are.
309+
Note that this does _not_ exactly match CommonMark's "Unicode punctuation character" definition.
310+
311+
```````````````````````````````` example
312+
http://☃.net?☃ // OtherSymbol
313+
314+
http://🍉.net?🍉 // A UTF-16 surrogate pair, but code point is OtherSymbol
315+
316+
http://‰.net?‰ // OtherPunctuation
317+
.
318+
<p><a href="http://xn--n3h.net?%E2%98%83">http://☃.net?☃</a> // OtherSymbol</p>
319+
<p><a href="http://xn--ji8h.net?%F0%9F%8D%89">http://🍉.net?🍉</a> // A UTF-16 surrogate pair, but code point is OtherSymbol</p>
320+
<p>http://‰.net?‰ // OtherPunctuation</p>
306321
````````````````````````````````

src/Markdig.Tests/Specs/CommonMark.generated.cs

Lines changed: 899 additions & 895 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)