`", "http://foo.bar.`baz`
", "");
}
}
+ // When a backtick string is not closed by a matching backtick string,
+ // we just have literal backticks:
[TestFixture]
public partial class TestInlinesCodespans
{
@@ -9443,12 +9452,31 @@ namespace Markdig.Tests
// Section: Inlines Code spans
//
// The following CommonMark:
+ // ```foo``
+ //
+ // Should be rendered as:
+ // ```foo``
+
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 326, "Inlines Code spans");
+ TestParser.TestSpec("```foo``", "```foo``
", "");
+ }
+ }
+ [TestFixture]
+ public partial class TestInlinesCodespans
+ {
+ [Test]
+ public void Example327()
+ {
+ // Example 327
+ // Section: Inlines Code spans
+ //
+ // The following CommonMark:
// `foo
//
// Should be rendered as:
// `foo
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 326, "Inlines Code spans");
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 327, "Inlines Code spans");
TestParser.TestSpec("`foo", "`foo
", "");
}
}
@@ -9660,9 +9688,9 @@ namespace Markdig.Tests
public partial class TestInlinesEmphasisandstrongemphasis
{
[Test]
- public void Example327()
+ public void Example328()
{
- // Example 327
+ // Example 328
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
@@ -9671,7 +9699,7 @@ namespace Markdig.Tests
// Should be rendered as:
// foo bar
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 327, "Inlines Emphasis and strong emphasis");
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 328, "Inlines Emphasis and strong emphasis");
TestParser.TestSpec("*foo bar*", "foo bar
", "");
}
}
@@ -9679,28 +9707,6 @@ namespace Markdig.Tests
// whitespace, and hence not part of a [left-flanking delimiter run]:
[TestFixture]
public partial class TestInlinesEmphasisandstrongemphasis
- {
- [Test]
- public void Example328()
- {
- // Example 328
- // Section: Inlines Emphasis and strong emphasis
- //
- // The following CommonMark:
- // a * foo bar*
- //
- // Should be rendered as:
- // a * foo bar*
-
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 328, "Inlines Emphasis and strong emphasis");
- TestParser.TestSpec("a * foo bar*", "a * foo bar*
", "");
- }
- }
- // This is not emphasis, because the opening `*` is preceded
- // by an alphanumeric and followed by punctuation, and hence
- // not part of a [left-flanking delimiter run]:
- [TestFixture]
- public partial class TestInlinesEmphasisandstrongemphasis
{
[Test]
public void Example329()
@@ -9709,16 +9715,18 @@ namespace Markdig.Tests
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
- // a*"foo"*
+ // a * foo bar*
//
// Should be rendered as:
- // a*"foo"*
+ // a * foo bar*
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 329, "Inlines Emphasis and strong emphasis");
- TestParser.TestSpec("a*\"foo\"*", "a*"foo"*
", "");
+ TestParser.TestSpec("a * foo bar*", "a * foo bar*
", "");
}
}
- // Unicode nonbreaking spaces count as whitespace, too:
+ // This is not emphasis, because the opening `*` is preceded
+ // by an alphanumeric and followed by punctuation, and hence
+ // not part of a [left-flanking delimiter run]:
[TestFixture]
public partial class TestInlinesEmphasisandstrongemphasis
{
@@ -9729,16 +9737,16 @@ namespace Markdig.Tests
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
- // * a *
+ // a*"foo"*
//
// Should be rendered as:
- // * a *
+ // a*"foo"*
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 330, "Inlines Emphasis and strong emphasis");
- TestParser.TestSpec("* a *", "* a *
", "");
+ TestParser.TestSpec("a*\"foo\"*", "a*"foo"*
", "");
}
}
- // Intraword emphasis with `*` is permitted:
+ // Unicode nonbreaking spaces count as whitespace, too:
[TestFixture]
public partial class TestInlinesEmphasisandstrongemphasis
{
@@ -9749,15 +9757,16 @@ namespace Markdig.Tests
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
- // foo*bar*
+ // * a *
//
// Should be rendered as:
- // foobar
+ // * a *
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 331, "Inlines Emphasis and strong emphasis");
- TestParser.TestSpec("foo*bar*", "foobar
", "");
+ TestParser.TestSpec("* a *", "* a *
", "");
}
}
+ // Intraword emphasis with `*` is permitted:
[TestFixture]
public partial class TestInlinesEmphasisandstrongemphasis
{
@@ -9768,16 +9777,15 @@ namespace Markdig.Tests
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
- // 5*6*78
+ // foo*bar*
//
// Should be rendered as:
- // 5678
+ // foobar
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 332, "Inlines Emphasis and strong emphasis");
- TestParser.TestSpec("5*6*78", "5678
", "");
+ TestParser.TestSpec("foo*bar*", "foobar
", "");
}
}
- // Rule 2:
[TestFixture]
public partial class TestInlinesEmphasisandstrongemphasis
{
@@ -9788,17 +9796,16 @@ namespace Markdig.Tests
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
- // _foo bar_
+ // 5*6*78
//
// Should be rendered as:
- // foo bar
+ // 5678
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 333, "Inlines Emphasis and strong emphasis");
- TestParser.TestSpec("_foo bar_", "foo bar
", "");
+ TestParser.TestSpec("5*6*78", "5678
", "");
}
}
- // This is not emphasis, because the opening `_` is followed by
- // whitespace:
+ // Rule 2:
[TestFixture]
public partial class TestInlinesEmphasisandstrongemphasis
{
@@ -9809,17 +9816,17 @@ namespace Markdig.Tests
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
- // _ foo bar_
+ // _foo bar_
//
// Should be rendered as:
- // _ foo bar_
+ // foo bar
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 334, "Inlines Emphasis and strong emphasis");
- TestParser.TestSpec("_ foo bar_", "_ foo bar_
", "");
+ TestParser.TestSpec("_foo bar_", "foo bar
", "");
}
}
- // This is not emphasis, because the opening `_` is preceded
- // by an alphanumeric and followed by punctuation:
+ // This is not emphasis, because the opening `_` is followed by
+ // whitespace:
[TestFixture]
public partial class TestInlinesEmphasisandstrongemphasis
{
@@ -9830,16 +9837,17 @@ namespace Markdig.Tests
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
- // a_"foo"_
+ // _ foo bar_
//
// Should be rendered as:
- // a_"foo"_
+ // _ foo bar_
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 335, "Inlines Emphasis and strong emphasis");
- TestParser.TestSpec("a_\"foo\"_", "a_"foo"_
", "");
+ TestParser.TestSpec("_ foo bar_", "_ foo bar_
", "");
}
}
- // Emphasis with `_` is not allowed inside words:
+ // This is not emphasis, because the opening `_` is preceded
+ // by an alphanumeric and followed by punctuation:
[TestFixture]
public partial class TestInlinesEmphasisandstrongemphasis
{
@@ -9850,15 +9858,16 @@ namespace Markdig.Tests
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
- // foo_bar_
+ // a_"foo"_
//
// Should be rendered as:
- // foo_bar_
+ // a_"foo"_
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 336, "Inlines Emphasis and strong emphasis");
- TestParser.TestSpec("foo_bar_", "foo_bar_
", "");
+ TestParser.TestSpec("a_\"foo\"_", "a_"foo"_
", "");
}
}
+ // Emphasis with `_` is not allowed inside words:
[TestFixture]
public partial class TestInlinesEmphasisandstrongemphasis
{
@@ -9869,13 +9878,13 @@ namespace Markdig.Tests
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
- // 5_6_78
+ // foo_bar_
//
// Should be rendered as:
- // 5_6_78
+ // foo_bar_
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 337, "Inlines Emphasis and strong emphasis");
- TestParser.TestSpec("5_6_78", "5_6_78
", "");
+ TestParser.TestSpec("foo_bar_", "foo_bar_
", "");
}
}
[TestFixture]
@@ -9888,17 +9897,15 @@ namespace Markdig.Tests
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
- // пристаням_стремятся_
+ // 5_6_78
//
// Should be rendered as:
- // пристаням_стремятся_
+ // 5_6_78
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 338, "Inlines Emphasis and strong emphasis");
- TestParser.TestSpec("пристаням_стремятся_", "пристаням_стремятся_
", "");
+ TestParser.TestSpec("5_6_78", "5_6_78
", "");
}
}
- // Here `_` does not generate emphasis, because the first delimiter run
- // is right-flanking and the second left-flanking:
[TestFixture]
public partial class TestInlinesEmphasisandstrongemphasis
{
@@ -9909,18 +9916,17 @@ namespace Markdig.Tests
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
- // aa_"bb"_cc
+ // пристаням_стремятся_
//
// Should be rendered as:
- // aa_"bb"_cc
+ // пристаням_стремятся_
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 339, "Inlines Emphasis and strong emphasis");
- TestParser.TestSpec("aa_\"bb\"_cc", "aa_"bb"_cc
", "");
+ TestParser.TestSpec("пристаням_стремятся_", "пристаням_стремятся_
", "");
}
}
- // This is emphasis, even though the opening delimiter is
- // both left- and right-flanking, because it is preceded by
- // punctuation:
+ // Here `_` does not generate emphasis, because the first delimiter run
+ // is right-flanking and the second left-flanking:
[TestFixture]
public partial class TestInlinesEmphasisandstrongemphasis
{
@@ -9931,12 +9937,34 @@ namespace Markdig.Tests
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
+ // aa_"bb"_cc
+ //
+ // Should be rendered as:
+ // aa_"bb"_cc
+
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 340, "Inlines Emphasis and strong emphasis");
+ TestParser.TestSpec("aa_\"bb\"_cc", "aa_"bb"_cc
", "");
+ }
+ }
+ // This is emphasis, even though the opening delimiter is
+ // both left- and right-flanking, because it is preceded by
+ // punctuation:
+ [TestFixture]
+ public partial class TestInlinesEmphasisandstrongemphasis
+ {
+ [Test]
+ public void Example341()
+ {
+ // Example 341
+ // Section: Inlines Emphasis and strong emphasis
+ //
+ // The following CommonMark:
// foo-_(bar)_
//
// Should be rendered as:
// foo-(bar)
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 340, "Inlines Emphasis and strong emphasis");
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 341, "Inlines Emphasis and strong emphasis");
TestParser.TestSpec("foo-_(bar)_", "foo-(bar)
", "");
}
}
@@ -9948,9 +9976,9 @@ namespace Markdig.Tests
public partial class TestInlinesEmphasisandstrongemphasis
{
[Test]
- public void Example341()
+ public void Example342()
{
- // Example 341
+ // Example 342
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
@@ -9959,7 +9987,7 @@ namespace Markdig.Tests
// Should be rendered as:
// _foo*
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 341, "Inlines Emphasis and strong emphasis");
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 342, "Inlines Emphasis and strong emphasis");
TestParser.TestSpec("_foo*", "_foo*
", "");
}
}
@@ -9967,26 +9995,6 @@ namespace Markdig.Tests
// whitespace:
[TestFixture]
public partial class TestInlinesEmphasisandstrongemphasis
- {
- [Test]
- public void Example342()
- {
- // Example 342
- // Section: Inlines Emphasis and strong emphasis
- //
- // The following CommonMark:
- // *foo bar *
- //
- // Should be rendered as:
- // *foo bar *
-
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 342, "Inlines Emphasis and strong emphasis");
- TestParser.TestSpec("*foo bar *", "*foo bar *
", "");
- }
- }
- // A newline also counts as whitespace:
- [TestFixture]
- public partial class TestInlinesEmphasisandstrongemphasis
{
[Test]
public void Example343()
@@ -9995,20 +10003,16 @@ namespace Markdig.Tests
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
- // *foo bar
- // *
+ // *foo bar *
//
// Should be rendered as:
- // *foo bar
- // *
+ // *foo bar *
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 343, "Inlines Emphasis and strong emphasis");
- TestParser.TestSpec("*foo bar\n*", "*foo bar\n*
", "");
+ TestParser.TestSpec("*foo bar *", "*foo bar *
", "");
}
}
- // This is not emphasis, because the second `*` is
- // preceded by punctuation and followed by an alphanumeric
- // (hence it is not part of a [right-flanking delimiter run]:
+ // A newline also counts as whitespace:
[TestFixture]
public partial class TestInlinesEmphasisandstrongemphasis
{
@@ -10019,17 +10023,20 @@ namespace Markdig.Tests
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
- // *(*foo)
+ // *foo bar
+ // *
//
// Should be rendered as:
- // *(*foo)
+ // *foo bar
+ // *
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 344, "Inlines Emphasis and strong emphasis");
- TestParser.TestSpec("*(*foo)", "*(*foo)
", "");
+ TestParser.TestSpec("*foo bar\n*", "*foo bar\n*
", "");
}
}
- // The point of this restriction is more easily appreciated
- // with this example:
+ // This is not emphasis, because the second `*` is
+ // preceded by punctuation and followed by an alphanumeric
+ // (hence it is not part of a [right-flanking delimiter run]:
[TestFixture]
public partial class TestInlinesEmphasisandstrongemphasis
{
@@ -10040,16 +10047,17 @@ namespace Markdig.Tests
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
- // *(*foo*)*
+ // *(*foo)
//
// Should be rendered as:
- // (foo)
+ // *(*foo)
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 345, "Inlines Emphasis and strong emphasis");
- TestParser.TestSpec("*(*foo*)*", "(foo)
", "");
+ TestParser.TestSpec("*(*foo)", "*(*foo)
", "");
}
}
- // Intraword emphasis with `*` is allowed:
+ // The point of this restriction is more easily appreciated
+ // with this example:
[TestFixture]
public partial class TestInlinesEmphasisandstrongemphasis
{
@@ -10060,12 +10068,32 @@ namespace Markdig.Tests
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
+ // *(*foo*)*
+ //
+ // Should be rendered as:
+ // (foo)
+
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 346, "Inlines Emphasis and strong emphasis");
+ TestParser.TestSpec("*(*foo*)*", "(foo)
", "");
+ }
+ }
+ // Intraword emphasis with `*` is allowed:
+ [TestFixture]
+ public partial class TestInlinesEmphasisandstrongemphasis
+ {
+ [Test]
+ public void Example347()
+ {
+ // Example 347
+ // Section: Inlines Emphasis and strong emphasis
+ //
+ // The following CommonMark:
// *foo*bar
//
// Should be rendered as:
// foobar
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 346, "Inlines Emphasis and strong emphasis");
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 347, "Inlines Emphasis and strong emphasis");
TestParser.TestSpec("*foo*bar", "foobar
", "");
}
}
@@ -10077,9 +10105,9 @@ namespace Markdig.Tests
public partial class TestInlinesEmphasisandstrongemphasis
{
[Test]
- public void Example347()
+ public void Example348()
{
- // Example 347
+ // Example 348
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
@@ -10088,7 +10116,7 @@ namespace Markdig.Tests
// Should be rendered as:
// _foo bar _
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 347, "Inlines Emphasis and strong emphasis");
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 348, "Inlines Emphasis and strong emphasis");
TestParser.TestSpec("_foo bar _", "_foo bar _
", "");
}
}
@@ -10096,26 +10124,6 @@ namespace Markdig.Tests
// preceded by punctuation and followed by an alphanumeric:
[TestFixture]
public partial class TestInlinesEmphasisandstrongemphasis
- {
- [Test]
- public void Example348()
- {
- // Example 348
- // Section: Inlines Emphasis and strong emphasis
- //
- // The following CommonMark:
- // _(_foo)
- //
- // Should be rendered as:
- // _(_foo)
-
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 348, "Inlines Emphasis and strong emphasis");
- TestParser.TestSpec("_(_foo)", "_(_foo)
", "");
- }
- }
- // This is emphasis within emphasis:
- [TestFixture]
- public partial class TestInlinesEmphasisandstrongemphasis
{
[Test]
public void Example349()
@@ -10124,16 +10132,16 @@ namespace Markdig.Tests
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
- // _(_foo_)_
+ // _(_foo)
//
// Should be rendered as:
- // (foo)
+ // _(_foo)
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 349, "Inlines Emphasis and strong emphasis");
- TestParser.TestSpec("_(_foo_)_", "(foo)
", "");
+ TestParser.TestSpec("_(_foo)", "_(_foo)
", "");
}
}
- // Intraword emphasis is disallowed for `_`:
+ // This is emphasis within emphasis:
[TestFixture]
public partial class TestInlinesEmphasisandstrongemphasis
{
@@ -10144,15 +10152,16 @@ namespace Markdig.Tests
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
- // _foo_bar
+ // _(_foo_)_
//
// Should be rendered as:
- // _foo_bar
+ // (foo)
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 350, "Inlines Emphasis and strong emphasis");
- TestParser.TestSpec("_foo_bar", "_foo_bar
", "");
+ TestParser.TestSpec("_(_foo_)_", "(foo)
", "");
}
}
+ // Intraword emphasis is disallowed for `_`:
[TestFixture]
public partial class TestInlinesEmphasisandstrongemphasis
{
@@ -10163,13 +10172,13 @@ namespace Markdig.Tests
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
- // _пристаням_стремятся
+ // _foo_bar
//
// Should be rendered as:
- // _пристаням_стремятся
+ // _foo_bar
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 351, "Inlines Emphasis and strong emphasis");
- TestParser.TestSpec("_пристаням_стремятся", "_пристаням_стремятся
", "");
+ TestParser.TestSpec("_foo_bar", "_foo_bar
", "");
}
}
[TestFixture]
@@ -10182,18 +10191,15 @@ namespace Markdig.Tests
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
- // _foo_bar_baz_
+ // _пристаням_стремятся
//
// Should be rendered as:
- // foo_bar_baz
+ // _пристаням_стремятся
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 352, "Inlines Emphasis and strong emphasis");
- TestParser.TestSpec("_foo_bar_baz_", "foo_bar_baz
", "");
+ TestParser.TestSpec("_пристаням_стремятся", "_пристаням_стремятся
", "");
}
}
- // This is emphasis, even though the closing delimiter is
- // both left- and right-flanking, because it is followed by
- // punctuation:
[TestFixture]
public partial class TestInlinesEmphasisandstrongemphasis
{
@@ -10204,16 +10210,18 @@ namespace Markdig.Tests
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
- // _(bar)_.
+ // _foo_bar_baz_
//
// Should be rendered as:
- // (bar).
+ // foo_bar_baz
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 353, "Inlines Emphasis and strong emphasis");
- TestParser.TestSpec("_(bar)_.", "(bar).
", "");
+ TestParser.TestSpec("_foo_bar_baz_", "foo_bar_baz
", "");
}
}
- // Rule 5:
+ // This is emphasis, even though the closing delimiter is
+ // both left- and right-flanking, because it is followed by
+ // punctuation:
[TestFixture]
public partial class TestInlinesEmphasisandstrongemphasis
{
@@ -10224,17 +10232,16 @@ namespace Markdig.Tests
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
- // **foo bar**
+ // _(bar)_.
//
// Should be rendered as:
- // foo bar
+ // (bar).
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 354, "Inlines Emphasis and strong emphasis");
- TestParser.TestSpec("**foo bar**", "foo bar
", "");
+ TestParser.TestSpec("_(bar)_.", "(bar).
", "");
}
}
- // This is not strong emphasis, because the opening delimiter is
- // followed by whitespace:
+ // Rule 5:
[TestFixture]
public partial class TestInlinesEmphasisandstrongemphasis
{
@@ -10245,18 +10252,17 @@ namespace Markdig.Tests
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
- // ** foo bar**
+ // **foo bar**
//
// Should be rendered as:
- // ** foo bar**
+ // foo bar
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 355, "Inlines Emphasis and strong emphasis");
- TestParser.TestSpec("** foo bar**", "** foo bar**
", "");
+ TestParser.TestSpec("**foo bar**", "foo bar
", "");
}
}
- // This is not strong emphasis, because the opening `**` is preceded
- // by an alphanumeric and followed by punctuation, and hence
- // not part of a [left-flanking delimiter run]:
+ // This is not strong emphasis, because the opening delimiter is
+ // followed by whitespace:
[TestFixture]
public partial class TestInlinesEmphasisandstrongemphasis
{
@@ -10267,16 +10273,18 @@ namespace Markdig.Tests
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
- // a**"foo"**
+ // ** foo bar**
//
// Should be rendered as:
- // a**"foo"**
+ // ** foo bar**
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 356, "Inlines Emphasis and strong emphasis");
- TestParser.TestSpec("a**\"foo\"**", "a**"foo"**
", "");
+ TestParser.TestSpec("** foo bar**", "** foo bar**
", "");
}
}
- // Intraword strong emphasis with `**` is permitted:
+ // This is not strong emphasis, because the opening `**` is preceded
+ // by an alphanumeric and followed by punctuation, and hence
+ // not part of a [left-flanking delimiter run]:
[TestFixture]
public partial class TestInlinesEmphasisandstrongemphasis
{
@@ -10287,16 +10295,16 @@ namespace Markdig.Tests
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
- // foo**bar**
+ // a**"foo"**
//
// Should be rendered as:
- // foobar
+ // a**"foo"**
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 357, "Inlines Emphasis and strong emphasis");
- TestParser.TestSpec("foo**bar**", "foobar
", "");
+ TestParser.TestSpec("a**\"foo\"**", "a**"foo"**
", "");
}
}
- // Rule 6:
+ // Intraword strong emphasis with `**` is permitted:
[TestFixture]
public partial class TestInlinesEmphasisandstrongemphasis
{
@@ -10307,17 +10315,16 @@ namespace Markdig.Tests
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
- // __foo bar__
+ // foo**bar**
//
// Should be rendered as:
- // foo bar
+ // foobar
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 358, "Inlines Emphasis and strong emphasis");
- TestParser.TestSpec("__foo bar__", "foo bar
", "");
+ TestParser.TestSpec("foo**bar**", "foobar
", "");
}
}
- // This is not strong emphasis, because the opening delimiter is
- // followed by whitespace:
+ // Rule 6:
[TestFixture]
public partial class TestInlinesEmphasisandstrongemphasis
{
@@ -10328,16 +10335,17 @@ namespace Markdig.Tests
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
- // __ foo bar__
+ // __foo bar__
//
// Should be rendered as:
- // __ foo bar__
+ // foo bar
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 359, "Inlines Emphasis and strong emphasis");
- TestParser.TestSpec("__ foo bar__", "__ foo bar__
", "");
+ TestParser.TestSpec("__foo bar__", "foo bar
", "");
}
}
- // A newline counts as whitespace:
+ // This is not strong emphasis, because the opening delimiter is
+ // followed by whitespace:
[TestFixture]
public partial class TestInlinesEmphasisandstrongemphasis
{
@@ -10348,19 +10356,16 @@ namespace Markdig.Tests
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
- // __
- // foo bar__
+ // __ foo bar__
//
// Should be rendered as:
- // __
- // foo bar__
+ // __ foo bar__
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 360, "Inlines Emphasis and strong emphasis");
- TestParser.TestSpec("__\nfoo bar__", "__\nfoo bar__
", "");
+ TestParser.TestSpec("__ foo bar__", "__ foo bar__
", "");
}
}
- // This is not strong emphasis, because the opening `__` is preceded
- // by an alphanumeric and followed by punctuation:
+ // A newline counts as whitespace:
[TestFixture]
public partial class TestInlinesEmphasisandstrongemphasis
{
@@ -10371,16 +10376,19 @@ namespace Markdig.Tests
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
- // a__"foo"__
+ // __
+ // foo bar__
//
// Should be rendered as:
- // a__"foo"__
+ // __
+ // foo bar__
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 361, "Inlines Emphasis and strong emphasis");
- TestParser.TestSpec("a__\"foo\"__", "a__"foo"__
", "");
+ TestParser.TestSpec("__\nfoo bar__", "__\nfoo bar__
", "");
}
}
- // Intraword strong emphasis is forbidden with `__`:
+ // This is not strong emphasis, because the opening `__` is preceded
+ // by an alphanumeric and followed by punctuation:
[TestFixture]
public partial class TestInlinesEmphasisandstrongemphasis
{
@@ -10391,15 +10399,16 @@ namespace Markdig.Tests
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
- // foo__bar__
+ // a__"foo"__
//
// Should be rendered as:
- // foo__bar__
+ // a__"foo"__
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 362, "Inlines Emphasis and strong emphasis");
- TestParser.TestSpec("foo__bar__", "foo__bar__
", "");
+ TestParser.TestSpec("a__\"foo\"__", "a__"foo"__
", "");
}
}
+ // Intraword strong emphasis is forbidden with `__`:
[TestFixture]
public partial class TestInlinesEmphasisandstrongemphasis
{
@@ -10410,13 +10419,13 @@ namespace Markdig.Tests
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
- // 5__6__78
+ // foo__bar__
//
// Should be rendered as:
- // 5__6__78
+ // foo__bar__
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 363, "Inlines Emphasis and strong emphasis");
- TestParser.TestSpec("5__6__78", "5__6__78
", "");
+ TestParser.TestSpec("foo__bar__", "foo__bar__
", "");
}
}
[TestFixture]
@@ -10429,13 +10438,13 @@ namespace Markdig.Tests
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
- // пристаням__стремятся__
+ // 5__6__78
//
// Should be rendered as:
- // пристаням__стремятся__
+ // 5__6__78
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 364, "Inlines Emphasis and strong emphasis");
- TestParser.TestSpec("пристаням__стремятся__", "пристаням__стремятся__
", "");
+ TestParser.TestSpec("5__6__78", "5__6__78
", "");
}
}
[TestFixture]
@@ -10448,18 +10457,15 @@ namespace Markdig.Tests
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
- // __foo, __bar__, baz__
+ // пристаням__стремятся__
//
// Should be rendered as:
- // foo, bar, baz
+ // пристаням__стремятся__
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 365, "Inlines Emphasis and strong emphasis");
- TestParser.TestSpec("__foo, __bar__, baz__", "foo, bar, baz
", "");
+ TestParser.TestSpec("пристаням__стремятся__", "пристаням__стремятся__
", "");
}
}
- // This is strong emphasis, even though the opening delimiter is
- // both left- and right-flanking, because it is preceded by
- // punctuation:
[TestFixture]
public partial class TestInlinesEmphasisandstrongemphasis
{
@@ -10470,12 +10476,34 @@ namespace Markdig.Tests
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
+ // __foo, __bar__, baz__
+ //
+ // Should be rendered as:
+ // foo, bar, baz
+
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 366, "Inlines Emphasis and strong emphasis");
+ TestParser.TestSpec("__foo, __bar__, baz__", "foo, bar, baz
", "");
+ }
+ }
+ // This is strong emphasis, even though the opening delimiter is
+ // both left- and right-flanking, because it is preceded by
+ // punctuation:
+ [TestFixture]
+ public partial class TestInlinesEmphasisandstrongemphasis
+ {
+ [Test]
+ public void Example367()
+ {
+ // Example 367
+ // Section: Inlines Emphasis and strong emphasis
+ //
+ // The following CommonMark:
// foo-__(bar)__
//
// Should be rendered as:
// foo-(bar)
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 366, "Inlines Emphasis and strong emphasis");
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 367, "Inlines Emphasis and strong emphasis");
TestParser.TestSpec("foo-__(bar)__", "foo-(bar)
", "");
}
}
@@ -10487,9 +10515,9 @@ namespace Markdig.Tests
public partial class TestInlinesEmphasisandstrongemphasis
{
[Test]
- public void Example367()
+ public void Example368()
{
- // Example 367
+ // Example 368
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
@@ -10498,7 +10526,7 @@ namespace Markdig.Tests
// Should be rendered as:
// **foo bar **
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 367, "Inlines Emphasis and strong emphasis");
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 368, "Inlines Emphasis and strong emphasis");
TestParser.TestSpec("**foo bar **", "**foo bar **
", "");
}
}
@@ -10511,9 +10539,9 @@ namespace Markdig.Tests
public partial class TestInlinesEmphasisandstrongemphasis
{
[Test]
- public void Example368()
+ public void Example369()
{
- // Example 368
+ // Example 369
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
@@ -10522,7 +10550,7 @@ namespace Markdig.Tests
// Should be rendered as:
// **(**foo)
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 368, "Inlines Emphasis and strong emphasis");
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 369, "Inlines Emphasis and strong emphasis");
TestParser.TestSpec("**(**foo)", "**(**foo)
", "");
}
}
@@ -10530,25 +10558,6 @@ namespace Markdig.Tests
// with these examples:
[TestFixture]
public partial class TestInlinesEmphasisandstrongemphasis
- {
- [Test]
- public void Example369()
- {
- // Example 369
- // Section: Inlines Emphasis and strong emphasis
- //
- // The following CommonMark:
- // *(**foo**)*
- //
- // Should be rendered as:
- // (foo)
-
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 369, "Inlines Emphasis and strong emphasis");
- TestParser.TestSpec("*(**foo**)*", "(foo)
", "");
- }
- }
- [TestFixture]
- public partial class TestInlinesEmphasisandstrongemphasis
{
[Test]
public void Example370()
@@ -10557,15 +10566,13 @@ namespace Markdig.Tests
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
- // **Gomphocarpus (*Gomphocarpus physocarpus*, syn.
- // *Asclepias physocarpa*)**
+ // *(**foo**)*
//
// Should be rendered as:
- // Gomphocarpus (Gomphocarpus physocarpus, syn.
- // Asclepias physocarpa)
+ // (foo)
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 370, "Inlines Emphasis and strong emphasis");
- TestParser.TestSpec("**Gomphocarpus (*Gomphocarpus physocarpus*, syn.\n*Asclepias physocarpa*)**", "Gomphocarpus (Gomphocarpus physocarpus, syn.\nAsclepias physocarpa)
", "");
+ TestParser.TestSpec("*(**foo**)*", "(foo)
", "");
}
}
[TestFixture]
@@ -10578,16 +10585,17 @@ namespace Markdig.Tests
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
- // **foo "*bar*" foo**
+ // **Gomphocarpus (*Gomphocarpus physocarpus*, syn.
+ // *Asclepias physocarpa*)**
//
// Should be rendered as:
- // foo "bar" foo
+ // Gomphocarpus (Gomphocarpus physocarpus, syn.
+ // Asclepias physocarpa)
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 371, "Inlines Emphasis and strong emphasis");
- TestParser.TestSpec("**foo \"*bar*\" foo**", "foo "bar" foo
", "");
+ TestParser.TestSpec("**Gomphocarpus (*Gomphocarpus physocarpus*, syn.\n*Asclepias physocarpa*)**", "Gomphocarpus (Gomphocarpus physocarpus, syn.\nAsclepias physocarpa)
", "");
}
}
- // Intraword emphasis:
[TestFixture]
public partial class TestInlinesEmphasisandstrongemphasis
{
@@ -10598,12 +10606,32 @@ namespace Markdig.Tests
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
+ // **foo "*bar*" foo**
+ //
+ // Should be rendered as:
+ // foo "bar" foo
+
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 372, "Inlines Emphasis and strong emphasis");
+ TestParser.TestSpec("**foo \"*bar*\" foo**", "foo "bar" foo
", "");
+ }
+ }
+ // Intraword emphasis:
+ [TestFixture]
+ public partial class TestInlinesEmphasisandstrongemphasis
+ {
+ [Test]
+ public void Example373()
+ {
+ // Example 373
+ // Section: Inlines Emphasis and strong emphasis
+ //
+ // The following CommonMark:
// **foo**bar
//
// Should be rendered as:
// foobar
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 372, "Inlines Emphasis and strong emphasis");
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 373, "Inlines Emphasis and strong emphasis");
TestParser.TestSpec("**foo**bar", "foobar
", "");
}
}
@@ -10615,9 +10643,9 @@ namespace Markdig.Tests
public partial class TestInlinesEmphasisandstrongemphasis
{
[Test]
- public void Example373()
+ public void Example374()
{
- // Example 373
+ // Example 374
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
@@ -10626,7 +10654,7 @@ namespace Markdig.Tests
// Should be rendered as:
// __foo bar __
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 373, "Inlines Emphasis and strong emphasis");
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 374, "Inlines Emphasis and strong emphasis");
TestParser.TestSpec("__foo bar __", "__foo bar __
", "");
}
}
@@ -10634,27 +10662,6 @@ namespace Markdig.Tests
// preceded by punctuation and followed by an alphanumeric:
[TestFixture]
public partial class TestInlinesEmphasisandstrongemphasis
- {
- [Test]
- public void Example374()
- {
- // Example 374
- // Section: Inlines Emphasis and strong emphasis
- //
- // The following CommonMark:
- // __(__foo)
- //
- // Should be rendered as:
- // __(__foo)
-
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 374, "Inlines Emphasis and strong emphasis");
- TestParser.TestSpec("__(__foo)", "__(__foo)
", "");
- }
- }
- // The point of this restriction is more easily appreciated
- // with this example:
- [TestFixture]
- public partial class TestInlinesEmphasisandstrongemphasis
{
[Test]
public void Example375()
@@ -10663,16 +10670,17 @@ namespace Markdig.Tests
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
- // _(__foo__)_
+ // __(__foo)
//
// Should be rendered as:
- // (foo)
+ // __(__foo)
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 375, "Inlines Emphasis and strong emphasis");
- TestParser.TestSpec("_(__foo__)_", "(foo)
", "");
+ TestParser.TestSpec("__(__foo)", "__(__foo)
", "");
}
}
- // Intraword strong emphasis is forbidden with `__`:
+ // The point of this restriction is more easily appreciated
+ // with this example:
[TestFixture]
public partial class TestInlinesEmphasisandstrongemphasis
{
@@ -10683,15 +10691,16 @@ namespace Markdig.Tests
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
- // __foo__bar
+ // _(__foo__)_
//
// Should be rendered as:
- // __foo__bar
+ // (foo)
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 376, "Inlines Emphasis and strong emphasis");
- TestParser.TestSpec("__foo__bar", "__foo__bar
", "");
+ TestParser.TestSpec("_(__foo__)_", "(foo)
", "");
}
}
+ // Intraword strong emphasis is forbidden with `__`:
[TestFixture]
public partial class TestInlinesEmphasisandstrongemphasis
{
@@ -10702,13 +10711,13 @@ namespace Markdig.Tests
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
- // __пристаням__стремятся
+ // __foo__bar
//
// Should be rendered as:
- // __пристаням__стремятся
+ // __foo__bar
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 377, "Inlines Emphasis and strong emphasis");
- TestParser.TestSpec("__пристаням__стремятся", "__пристаням__стремятся
", "");
+ TestParser.TestSpec("__foo__bar", "__foo__bar
", "");
}
}
[TestFixture]
@@ -10721,18 +10730,15 @@ namespace Markdig.Tests
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
- // __foo__bar__baz__
+ // __пристаням__стремятся
//
// Should be rendered as:
- // foo__bar__baz
+ // __пристаням__стремятся
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 378, "Inlines Emphasis and strong emphasis");
- TestParser.TestSpec("__foo__bar__baz__", "foo__bar__baz
", "");
+ TestParser.TestSpec("__пристаням__стремятся", "__пристаням__стремятся
", "");
}
}
- // This is strong emphasis, even though the closing delimiter is
- // both left- and right-flanking, because it is followed by
- // punctuation:
[TestFixture]
public partial class TestInlinesEmphasisandstrongemphasis
{
@@ -10743,12 +10749,34 @@ namespace Markdig.Tests
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
+ // __foo__bar__baz__
+ //
+ // Should be rendered as:
+ // foo__bar__baz
+
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 379, "Inlines Emphasis and strong emphasis");
+ TestParser.TestSpec("__foo__bar__baz__", "foo__bar__baz
", "");
+ }
+ }
+ // This is strong emphasis, even though the closing delimiter is
+ // both left- and right-flanking, because it is followed by
+ // punctuation:
+ [TestFixture]
+ public partial class TestInlinesEmphasisandstrongemphasis
+ {
+ [Test]
+ public void Example380()
+ {
+ // Example 380
+ // Section: Inlines Emphasis and strong emphasis
+ //
+ // The following CommonMark:
// __(bar)__.
//
// Should be rendered as:
// (bar).
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 379, "Inlines Emphasis and strong emphasis");
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 380, "Inlines Emphasis and strong emphasis");
TestParser.TestSpec("__(bar)__.", "(bar).
", "");
}
}
@@ -10760,9 +10788,9 @@ namespace Markdig.Tests
public partial class TestInlinesEmphasisandstrongemphasis
{
[Test]
- public void Example380()
+ public void Example381()
{
- // Example 380
+ // Example 381
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
@@ -10771,35 +10799,12 @@ namespace Markdig.Tests
// Should be rendered as:
// foo bar
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 380, "Inlines Emphasis and strong emphasis");
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 381, "Inlines Emphasis and strong emphasis");
TestParser.TestSpec("*foo [bar](/url)*", "foo bar
", "");
}
}
[TestFixture]
public partial class TestInlinesEmphasisandstrongemphasis
- {
- [Test]
- public void Example381()
- {
- // Example 381
- // Section: Inlines Emphasis and strong emphasis
- //
- // The following CommonMark:
- // *foo
- // bar*
- //
- // Should be rendered as:
- // foo
- // bar
-
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 381, "Inlines Emphasis and strong emphasis");
- TestParser.TestSpec("*foo\nbar*", "foo\nbar
", "");
- }
- }
- // In particular, emphasis and strong emphasis can be nested
- // inside emphasis:
- [TestFixture]
- public partial class TestInlinesEmphasisandstrongemphasis
{
[Test]
public void Example382()
@@ -10808,15 +10813,19 @@ namespace Markdig.Tests
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
- // _foo __bar__ baz_
+ // *foo
+ // bar*
//
// Should be rendered as:
- // foo bar baz
+ // foo
+ // bar
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 382, "Inlines Emphasis and strong emphasis");
- TestParser.TestSpec("_foo __bar__ baz_", "foo bar baz
", "");
+ TestParser.TestSpec("*foo\nbar*", "foo\nbar
", "");
}
}
+ // In particular, emphasis and strong emphasis can be nested
+ // inside emphasis:
[TestFixture]
public partial class TestInlinesEmphasisandstrongemphasis
{
@@ -10827,13 +10836,13 @@ namespace Markdig.Tests
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
- // _foo _bar_ baz_
+ // _foo __bar__ baz_
//
// Should be rendered as:
- // foo bar baz
+ // foo bar baz
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 383, "Inlines Emphasis and strong emphasis");
- TestParser.TestSpec("_foo _bar_ baz_", "foo bar baz
", "");
+ TestParser.TestSpec("_foo __bar__ baz_", "foo bar baz
", "");
}
}
[TestFixture]
@@ -10846,13 +10855,13 @@ namespace Markdig.Tests
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
- // __foo_ bar_
+ // _foo _bar_ baz_
//
// Should be rendered as:
- // foo bar
+ // foo bar baz
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 384, "Inlines Emphasis and strong emphasis");
- TestParser.TestSpec("__foo_ bar_", "foo bar
", "");
+ TestParser.TestSpec("_foo _bar_ baz_", "foo bar baz
", "");
}
}
[TestFixture]
@@ -10865,13 +10874,13 @@ namespace Markdig.Tests
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
- // *foo *bar**
+ // __foo_ bar_
//
// Should be rendered as:
- // foo bar
+ // foo bar
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 385, "Inlines Emphasis and strong emphasis");
- TestParser.TestSpec("*foo *bar**", "foo bar
", "");
+ TestParser.TestSpec("__foo_ bar_", "foo bar
", "");
}
}
[TestFixture]
@@ -10884,13 +10893,13 @@ namespace Markdig.Tests
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
- // *foo **bar** baz*
+ // *foo *bar**
//
// Should be rendered as:
- // foo bar baz
+ // foo bar
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 386, "Inlines Emphasis and strong emphasis");
- TestParser.TestSpec("*foo **bar** baz*", "foo bar baz
", "");
+ TestParser.TestSpec("*foo *bar**", "foo bar
", "");
}
}
[TestFixture]
@@ -10903,12 +10912,31 @@ namespace Markdig.Tests
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
+ // *foo **bar** baz*
+ //
+ // Should be rendered as:
+ // foo bar baz
+
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 387, "Inlines Emphasis and strong emphasis");
+ TestParser.TestSpec("*foo **bar** baz*", "foo bar baz
", "");
+ }
+ }
+ [TestFixture]
+ public partial class TestInlinesEmphasisandstrongemphasis
+ {
+ [Test]
+ public void Example388()
+ {
+ // Example 388
+ // Section: Inlines Emphasis and strong emphasis
+ //
+ // The following CommonMark:
// *foo**bar**baz*
//
// Should be rendered as:
// foobarbaz
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 387, "Inlines Emphasis and strong emphasis");
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 388, "Inlines Emphasis and strong emphasis");
TestParser.TestSpec("*foo**bar**baz*", "foobarbaz
", "");
}
}
@@ -10919,7 +10947,7 @@ namespace Markdig.Tests
// ```
//
// is precluded by the condition that a delimiter that
- // can both open and close (like the `*` after `foo`
+ // can both open and close (like the `*` after `foo`)
// cannot form emphasis if the sum of the lengths of
// the delimiter runs containing the opening and
// closing delimiters is a multiple of 3.
@@ -10932,9 +10960,9 @@ namespace Markdig.Tests
public partial class TestInlinesEmphasisandstrongemphasis
{
[Test]
- public void Example388()
+ public void Example389()
{
- // Example 388
+ // Example 389
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
@@ -10943,27 +10971,8 @@ namespace Markdig.Tests
// Should be rendered as:
// foo bar
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 388, "Inlines Emphasis and strong emphasis");
- TestParser.TestSpec("***foo** bar*", "foo bar
", "");
- }
- }
- [TestFixture]
- public partial class TestInlinesEmphasisandstrongemphasis
- {
- [Test]
- public void Example389()
- {
- // Example 389
- // Section: Inlines Emphasis and strong emphasis
- //
- // The following CommonMark:
- // *foo **bar***
- //
- // Should be rendered as:
- // foo bar
-
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 389, "Inlines Emphasis and strong emphasis");
- TestParser.TestSpec("*foo **bar***", "foo bar
", "");
+ TestParser.TestSpec("***foo** bar*", "foo bar
", "");
}
}
[TestFixture]
@@ -10976,13 +10985,13 @@ namespace Markdig.Tests
// Section: Inlines Emphasis and strong emphasis
//
// The following CommonMark:
- // *foo**bar***
+ // *foo **bar***
//
// Should be rendered as:
- // foobar
+ // foo bar
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 390, "Inlines Emphasis and strong emphasis");
- TestParser.TestSpec("*foo**bar***", "foobar
", "");
+ TestParser.TestSpec("*foo **bar***", "foo bar
", "");
}
}
[TestFixture]
@@ -12744,7 +12753,8 @@ namespace Markdig.Tests
TestParser.TestSpec("[link](/url \"title \\\""\")", "link
", "");
}
}
- // Nested balanced quotes are not allowed without escaping:
+ // Titles must be separated from the link using a [whitespace].
+ // Other [Unicode whitespace] like non-breaking space doesn't work.
[TestFixture]
public partial class TestInlinesLinks
{
@@ -12755,16 +12765,16 @@ namespace Markdig.Tests
// Section: Inlines Links
//
// The following CommonMark:
- // [link](/url "title "and" title")
+ // [link](/url "title")
//
// Should be rendered as:
- // [link](/url "title "and" title")
+ // link
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 476, "Inlines Links");
- TestParser.TestSpec("[link](/url \"title \"and\" title\")", "[link](/url "title "and" title")
", "");
+ TestParser.TestSpec("[link](/url \"title\")", "link
", "");
}
}
- // But it is easy to work around this by using a different quote type:
+ // Nested balanced quotes are not allowed without escaping:
[TestFixture]
public partial class TestInlinesLinks
{
@@ -12775,12 +12785,32 @@ namespace Markdig.Tests
// Section: Inlines Links
//
// The following CommonMark:
+ // [link](/url "title "and" title")
+ //
+ // Should be rendered as:
+ // [link](/url "title "and" title")
+
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 477, "Inlines Links");
+ TestParser.TestSpec("[link](/url \"title \"and\" title\")", "[link](/url "title "and" title")
", "");
+ }
+ }
+ // But it is easy to work around this by using a different quote type:
+ [TestFixture]
+ public partial class TestInlinesLinks
+ {
+ [Test]
+ public void Example478()
+ {
+ // Example 478
+ // Section: Inlines Links
+ //
+ // The following CommonMark:
// [link](/url 'title "and" title')
//
// Should be rendered as:
// link
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 477, "Inlines Links");
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 478, "Inlines Links");
TestParser.TestSpec("[link](/url 'title \"and\" title')", "link
", "");
}
}
@@ -12804,9 +12834,9 @@ namespace Markdig.Tests
public partial class TestInlinesLinks
{
[Test]
- public void Example478()
+ public void Example479()
{
- // Example 478
+ // Example 479
// Section: Inlines Links
//
// The following CommonMark:
@@ -12816,7 +12846,7 @@ namespace Markdig.Tests
// Should be rendered as:
// link
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 478, "Inlines Links");
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 479, "Inlines Links");
TestParser.TestSpec("[link]( /uri\n \"title\" )", "link
", "");
}
}
@@ -12824,27 +12854,6 @@ namespace Markdig.Tests
// following parenthesis:
[TestFixture]
public partial class TestInlinesLinks
- {
- [Test]
- public void Example479()
- {
- // Example 479
- // Section: Inlines Links
- //
- // The following CommonMark:
- // [link] (/uri)
- //
- // Should be rendered as:
- // [link] (/uri)
-
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 479, "Inlines Links");
- TestParser.TestSpec("[link] (/uri)", "[link] (/uri)
", "");
- }
- }
- // The link text may contain balanced brackets, but not unbalanced ones,
- // unless they are escaped:
- [TestFixture]
- public partial class TestInlinesLinks
{
[Test]
public void Example480()
@@ -12853,15 +12862,17 @@ namespace Markdig.Tests
// Section: Inlines Links
//
// The following CommonMark:
- // [link [foo [bar]]](/uri)
+ // [link] (/uri)
//
// Should be rendered as:
- // link [foo [bar]]
+ // [link] (/uri)
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 480, "Inlines Links");
- TestParser.TestSpec("[link [foo [bar]]](/uri)", "link [foo [bar]]
", "");
+ TestParser.TestSpec("[link] (/uri)", "[link] (/uri)
", "");
}
}
+ // The link text may contain balanced brackets, but not unbalanced ones,
+ // unless they are escaped:
[TestFixture]
public partial class TestInlinesLinks
{
@@ -12872,13 +12883,13 @@ namespace Markdig.Tests
// Section: Inlines Links
//
// The following CommonMark:
- // [link] bar](/uri)
+ // [link [foo [bar]]](/uri)
//
// Should be rendered as:
- // [link] bar](/uri)
+ // link [foo [bar]]
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 481, "Inlines Links");
- TestParser.TestSpec("[link] bar](/uri)", "[link] bar](/uri)
", "");
+ TestParser.TestSpec("[link [foo [bar]]](/uri)", "link [foo [bar]]
", "");
}
}
[TestFixture]
@@ -12891,13 +12902,13 @@ namespace Markdig.Tests
// Section: Inlines Links
//
// The following CommonMark:
- // [link [bar](/uri)
+ // [link] bar](/uri)
//
// Should be rendered as:
- // [link bar
+ // [link] bar](/uri)
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 482, "Inlines Links");
- TestParser.TestSpec("[link [bar](/uri)", "[link bar
", "");
+ TestParser.TestSpec("[link] bar](/uri)", "[link] bar](/uri)
", "");
}
}
[TestFixture]
@@ -12910,16 +12921,15 @@ namespace Markdig.Tests
// Section: Inlines Links
//
// The following CommonMark:
- // [link \[bar](/uri)
+ // [link [bar](/uri)
//
// Should be rendered as:
- // link [bar
+ // [link bar
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 483, "Inlines Links");
- TestParser.TestSpec("[link \\[bar](/uri)", "link [bar
", "");
+ TestParser.TestSpec("[link [bar](/uri)", "[link bar
", "");
}
}
- // The link text may contain inline content:
[TestFixture]
public partial class TestInlinesLinks
{
@@ -12930,15 +12940,16 @@ namespace Markdig.Tests
// Section: Inlines Links
//
// The following CommonMark:
- // [link *foo **bar** `#`*](/uri)
+ // [link \[bar](/uri)
//
// Should be rendered as:
- // link foo bar #
+ // link [bar
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 484, "Inlines Links");
- TestParser.TestSpec("[link *foo **bar** `#`*](/uri)", "link foo bar #
", "");
+ TestParser.TestSpec("[link \\[bar](/uri)", "link [bar
", "");
}
}
+ // The link text may contain inline content:
[TestFixture]
public partial class TestInlinesLinks
{
@@ -12949,16 +12960,15 @@ namespace Markdig.Tests
// Section: Inlines Links
//
// The following CommonMark:
- // [](/uri)
+ // [link *foo **bar** `#`*](/uri)
//
// Should be rendered as:
- // 
+ // link foo bar #
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 485, "Inlines Links");
- TestParser.TestSpec("[](/uri)", "
", "");
+ TestParser.TestSpec("[link *foo **bar** `#`*](/uri)", "link foo bar #
", "");
}
}
- // However, links may not contain other links, at any level of nesting.
[TestFixture]
public partial class TestInlinesLinks
{
@@ -12969,15 +12979,16 @@ namespace Markdig.Tests
// Section: Inlines Links
//
// The following CommonMark:
- // [foo [bar](/uri)](/uri)
+ // [](/uri)
//
// Should be rendered as:
- // [foo bar](/uri)
+ // 
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 486, "Inlines Links");
- TestParser.TestSpec("[foo [bar](/uri)](/uri)", "[foo bar](/uri)
", "");
+ TestParser.TestSpec("[](/uri)", "
", "");
}
}
+ // However, links may not contain other links, at any level of nesting.
[TestFixture]
public partial class TestInlinesLinks
{
@@ -12988,13 +12999,13 @@ namespace Markdig.Tests
// Section: Inlines Links
//
// The following CommonMark:
- // [foo *[bar [baz](/uri)](/uri)*](/uri)
+ // [foo [bar](/uri)](/uri)
//
// Should be rendered as:
- // [foo [bar baz](/uri)](/uri)
+ // [foo bar](/uri)
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 487, "Inlines Links");
- TestParser.TestSpec("[foo *[bar [baz](/uri)](/uri)*](/uri)", "[foo [bar baz](/uri)](/uri)
", "");
+ TestParser.TestSpec("[foo [bar](/uri)](/uri)", "[foo bar](/uri)
", "");
}
}
[TestFixture]
@@ -13007,17 +13018,15 @@ namespace Markdig.Tests
// Section: Inlines Links
//
// The following CommonMark:
- // ](uri2)](uri3)
+ // [foo *[bar [baz](/uri)](/uri)*](/uri)
//
// Should be rendered as:
- // ](uri3)
+ // [foo [bar baz](/uri)](/uri)
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 488, "Inlines Links");
- TestParser.TestSpec("](uri2)](uri3)", "\"](\"uri3\")
", "");
+ TestParser.TestSpec("[foo *[bar [baz](/uri)](/uri)*](/uri)", "[foo [bar baz](/uri)](/uri)
", "");
}
}
- // These cases illustrate the precedence of link text grouping over
- // emphasis grouping:
[TestFixture]
public partial class TestInlinesLinks
{
@@ -13028,15 +13037,17 @@ namespace Markdig.Tests
// Section: Inlines Links
//
// The following CommonMark:
- // *[foo*](/uri)
+ // ](uri2)](uri3)
//
// Should be rendered as:
- // *foo*
+ // ](uri3)
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 489, "Inlines Links");
- TestParser.TestSpec("*[foo*](/uri)", "*foo*
", "");
+ TestParser.TestSpec("](uri2)](uri3)", "\"](\"uri3\")
", "");
}
}
+ // These cases illustrate the precedence of link text grouping over
+ // emphasis grouping:
[TestFixture]
public partial class TestInlinesLinks
{
@@ -13047,17 +13058,15 @@ namespace Markdig.Tests
// Section: Inlines Links
//
// The following CommonMark:
- // [foo *bar](baz*)
+ // *[foo*](/uri)
//
// Should be rendered as:
- // foo *bar
+ // *foo*
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 490, "Inlines Links");
- TestParser.TestSpec("[foo *bar](baz*)", "foo *bar
", "");
+ TestParser.TestSpec("*[foo*](/uri)", "*foo*
", "");
}
}
- // Note that brackets that *aren't* part of links do not take
- // precedence:
[TestFixture]
public partial class TestInlinesLinks
{
@@ -13068,17 +13077,17 @@ namespace Markdig.Tests
// Section: Inlines Links
//
// The following CommonMark:
- // *foo [bar* baz]
+ // [foo *bar](baz*)
//
// Should be rendered as:
- // foo [bar baz]
+ // foo *bar
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 491, "Inlines Links");
- TestParser.TestSpec("*foo [bar* baz]", "foo [bar baz]
", "");
+ TestParser.TestSpec("[foo *bar](baz*)", "foo *bar
", "");
}
}
- // These cases illustrate the precedence of HTML tags, code spans,
- // and autolinks over link grouping:
+ // Note that brackets that *aren't* part of links do not take
+ // precedence:
[TestFixture]
public partial class TestInlinesLinks
{
@@ -13089,15 +13098,17 @@ namespace Markdig.Tests
// Section: Inlines Links
//
// The following CommonMark:
- // [foo
+ // *foo [bar* baz]
//
// Should be rendered as:
- // [foo
+ // foo [bar baz]
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 492, "Inlines Links");
- TestParser.TestSpec("[foo ", "[foo
", "");
+ TestParser.TestSpec("*foo [bar* baz]", "foo [bar baz]
", "");
}
}
+ // These cases illustrate the precedence of HTML tags, code spans,
+ // and autolinks over link grouping:
[TestFixture]
public partial class TestInlinesLinks
{
@@ -13108,13 +13119,13 @@ namespace Markdig.Tests
// Section: Inlines Links
//
// The following CommonMark:
- // [foo`](/uri)`
+ // [foo
//
// Should be rendered as:
- // [foo](/uri)
+ // [foo
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 493, "Inlines Links");
- TestParser.TestSpec("[foo`](/uri)`", "[foo](/uri)
", "");
+ TestParser.TestSpec("[foo ", "[foo
", "");
}
}
[TestFixture]
@@ -13127,12 +13138,31 @@ namespace Markdig.Tests
// Section: Inlines Links
//
// The following CommonMark:
+ // [foo`](/uri)`
+ //
+ // Should be rendered as:
+ // [foo](/uri)
+
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 494, "Inlines Links");
+ TestParser.TestSpec("[foo`](/uri)`", "[foo](/uri)
", "");
+ }
+ }
+ [TestFixture]
+ public partial class TestInlinesLinks
+ {
+ [Test]
+ public void Example495()
+ {
+ // Example 495
+ // Section: Inlines Links
+ //
+ // The following CommonMark:
// [foo
//
// Should be rendered as:
// [foohttp://example.com/?search=](uri)
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 494, "Inlines Links");
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 495, "Inlines Links");
TestParser.TestSpec("[foo", "[foohttp://example.com/?search=](uri)
", "");
}
}
@@ -13167,9 +13197,9 @@ namespace Markdig.Tests
public partial class TestInlinesLinks
{
[Test]
- public void Example495()
+ public void Example496()
{
- // Example 495
+ // Example 496
// Section: Inlines Links
//
// The following CommonMark:
@@ -13180,7 +13210,7 @@ namespace Markdig.Tests
// Should be rendered as:
// foo
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 495, "Inlines Links");
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 496, "Inlines Links");
TestParser.TestSpec("[foo][bar]\n\n[bar]: /url \"title\"", "foo
", "");
}
}
@@ -13193,9 +13223,9 @@ namespace Markdig.Tests
public partial class TestInlinesLinks
{
[Test]
- public void Example496()
+ public void Example497()
{
- // Example 496
+ // Example 497
// Section: Inlines Links
//
// The following CommonMark:
@@ -13206,34 +13236,12 @@ namespace Markdig.Tests
// Should be rendered as:
// link [foo [bar]]
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 496, "Inlines Links");
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 497, "Inlines Links");
TestParser.TestSpec("[link [foo [bar]]][ref]\n\n[ref]: /uri", "link [foo [bar]]
", "");
}
}
[TestFixture]
public partial class TestInlinesLinks
- {
- [Test]
- public void Example497()
- {
- // Example 497
- // Section: Inlines Links
- //
- // The following CommonMark:
- // [link \[bar][ref]
- //
- // [ref]: /uri
- //
- // Should be rendered as:
- // link [bar
-
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 497, "Inlines Links");
- TestParser.TestSpec("[link \\[bar][ref]\n\n[ref]: /uri", "link [bar
", "");
- }
- }
- // The link text may contain inline content:
- [TestFixture]
- public partial class TestInlinesLinks
{
[Test]
public void Example498()
@@ -13242,17 +13250,18 @@ namespace Markdig.Tests
// Section: Inlines Links
//
// The following CommonMark:
- // [link *foo **bar** `#`*][ref]
+ // [link \[bar][ref]
//
// [ref]: /uri
//
// Should be rendered as:
- // link foo bar #
+ // link [bar
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 498, "Inlines Links");
- TestParser.TestSpec("[link *foo **bar** `#`*][ref]\n\n[ref]: /uri", "link foo bar #
", "");
+ TestParser.TestSpec("[link \\[bar][ref]\n\n[ref]: /uri", "link [bar
", "");
}
}
+ // The link text may contain inline content:
[TestFixture]
public partial class TestInlinesLinks
{
@@ -13263,18 +13272,17 @@ namespace Markdig.Tests
// Section: Inlines Links
//
// The following CommonMark:
- // [][ref]
+ // [link *foo **bar** `#`*][ref]
//
// [ref]: /uri
//
// Should be rendered as:
- // 
+ // link foo bar #
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 499, "Inlines Links");
- TestParser.TestSpec("[][ref]\n\n[ref]: /uri", "
", "");
+ TestParser.TestSpec("[link *foo **bar** `#`*][ref]\n\n[ref]: /uri", "link foo bar #
", "");
}
}
- // However, links may not contain other links, at any level of nesting.
[TestFixture]
public partial class TestInlinesLinks
{
@@ -13285,17 +13293,18 @@ namespace Markdig.Tests
// Section: Inlines Links
//
// The following CommonMark:
- // [foo [bar](/uri)][ref]
+ // [][ref]
//
// [ref]: /uri
//
// Should be rendered as:
- // [foo bar]ref
+ // 
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 500, "Inlines Links");
- TestParser.TestSpec("[foo [bar](/uri)][ref]\n\n[ref]: /uri", "[foo bar]ref
", "");
+ TestParser.TestSpec("[][ref]\n\n[ref]: /uri", "
", "");
}
}
+ // However, links may not contain other links, at any level of nesting.
[TestFixture]
public partial class TestInlinesLinks
{
@@ -13306,6 +13315,27 @@ namespace Markdig.Tests
// Section: Inlines Links
//
// The following CommonMark:
+ // [foo [bar](/uri)][ref]
+ //
+ // [ref]: /uri
+ //
+ // Should be rendered as:
+ // [foo bar]ref
+
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 501, "Inlines Links");
+ TestParser.TestSpec("[foo [bar](/uri)][ref]\n\n[ref]: /uri", "[foo bar]ref
", "");
+ }
+ }
+ [TestFixture]
+ public partial class TestInlinesLinks
+ {
+ [Test]
+ public void Example502()
+ {
+ // Example 502
+ // Section: Inlines Links
+ //
+ // The following CommonMark:
// [foo *bar [baz][ref]*][ref]
//
// [ref]: /uri
@@ -13313,7 +13343,7 @@ namespace Markdig.Tests
// Should be rendered as:
// [foo bar baz]ref
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 501, "Inlines Links");
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 502, "Inlines Links");
TestParser.TestSpec("[foo *bar [baz][ref]*][ref]\n\n[ref]: /uri", "[foo bar baz]ref
", "");
}
}
@@ -13326,9 +13356,9 @@ namespace Markdig.Tests
public partial class TestInlinesLinks
{
[Test]
- public void Example502()
+ public void Example503()
{
- // Example 502
+ // Example 503
// Section: Inlines Links
//
// The following CommonMark:
@@ -13339,35 +13369,12 @@ namespace Markdig.Tests
// Should be rendered as:
// *foo*
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 502, "Inlines Links");
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 503, "Inlines Links");
TestParser.TestSpec("*[foo*][ref]\n\n[ref]: /uri", "*foo*
", "");
}
}
[TestFixture]
public partial class TestInlinesLinks
- {
- [Test]
- public void Example503()
- {
- // Example 503
- // Section: Inlines Links
- //
- // The following CommonMark:
- // [foo *bar][ref]
- //
- // [ref]: /uri
- //
- // Should be rendered as:
- // foo *bar
-
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 503, "Inlines Links");
- TestParser.TestSpec("[foo *bar][ref]\n\n[ref]: /uri", "foo *bar
", "");
- }
- }
- // These cases illustrate the precedence of HTML tags, code spans,
- // and autolinks over link grouping:
- [TestFixture]
- public partial class TestInlinesLinks
{
[Test]
public void Example504()
@@ -13376,17 +13383,19 @@ namespace Markdig.Tests
// Section: Inlines Links
//
// The following CommonMark:
- // [foo
+ // [foo *bar][ref]
//
// [ref]: /uri
//
// Should be rendered as:
- // [foo
+ // foo *bar
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 504, "Inlines Links");
- TestParser.TestSpec("[foo \n\n[ref]: /uri", "[foo
", "");
+ TestParser.TestSpec("[foo *bar][ref]\n\n[ref]: /uri", "foo *bar
", "");
}
}
+ // These cases illustrate the precedence of HTML tags, code spans,
+ // and autolinks over link grouping:
[TestFixture]
public partial class TestInlinesLinks
{
@@ -13397,15 +13406,15 @@ namespace Markdig.Tests
// Section: Inlines Links
//
// The following CommonMark:
- // [foo`][ref]`
+ // [foo
//
// [ref]: /uri
//
// Should be rendered as:
- // [foo][ref]
+ // [foo
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 505, "Inlines Links");
- TestParser.TestSpec("[foo`][ref]`\n\n[ref]: /uri", "[foo][ref]
", "");
+ TestParser.TestSpec("[foo \n\n[ref]: /uri", "[foo
", "");
}
}
[TestFixture]
@@ -13418,18 +13427,17 @@ namespace Markdig.Tests
// Section: Inlines Links
//
// The following CommonMark:
- // [foo
+ // [foo`][ref]`
//
// [ref]: /uri
//
// Should be rendered as:
- // [foohttp://example.com/?search=][ref]
+ // [foo][ref]
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 506, "Inlines Links");
- TestParser.TestSpec("[foo\n\n[ref]: /uri", "[foohttp://example.com/?search=][ref]
", "");
+ TestParser.TestSpec("[foo`][ref]`\n\n[ref]: /uri", "[foo][ref]
", "");
}
}
- // Matching is case-insensitive:
[TestFixture]
public partial class TestInlinesLinks
{
@@ -13440,18 +13448,18 @@ namespace Markdig.Tests
// Section: Inlines Links
//
// The following CommonMark:
- // [foo][BaR]
+ // [foo
//
- // [bar]: /url "title"
+ // [ref]: /uri
//
// Should be rendered as:
- // foo
+ // [foohttp://example.com/?search=][ref]
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 507, "Inlines Links");
- TestParser.TestSpec("[foo][BaR]\n\n[bar]: /url \"title\"", "foo
", "");
+ TestParser.TestSpec("[foo\n\n[ref]: /uri", "[foohttp://example.com/?search=][ref]
", "");
}
}
- // Unicode case fold is used:
+ // Matching is case-insensitive:
[TestFixture]
public partial class TestInlinesLinks
{
@@ -13462,6 +13470,28 @@ namespace Markdig.Tests
// Section: Inlines Links
//
// The following CommonMark:
+ // [foo][BaR]
+ //
+ // [bar]: /url "title"
+ //
+ // Should be rendered as:
+ // foo
+
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 508, "Inlines Links");
+ TestParser.TestSpec("[foo][BaR]\n\n[bar]: /url \"title\"", "foo
", "");
+ }
+ }
+ // Unicode case fold is used:
+ [TestFixture]
+ public partial class TestInlinesLinks
+ {
+ [Test]
+ public void Example509()
+ {
+ // Example 509
+ // Section: Inlines Links
+ //
+ // The following CommonMark:
// [Толпой][Толпой] is a Russian word.
//
// [ТОЛПОЙ]: /url
@@ -13469,7 +13499,7 @@ namespace Markdig.Tests
// Should be rendered as:
// Толпой is a Russian word.
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 508, "Inlines Links");
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 509, "Inlines Links");
TestParser.TestSpec("[Толпой][Толпой] is a Russian word.\n\n[ТОЛПОЙ]: /url", "Толпой is a Russian word.
", "");
}
}
@@ -13479,9 +13509,9 @@ namespace Markdig.Tests
public partial class TestInlinesLinks
{
[Test]
- public void Example509()
+ public void Example510()
{
- // Example 509
+ // Example 510
// Section: Inlines Links
//
// The following CommonMark:
@@ -13493,7 +13523,7 @@ namespace Markdig.Tests
// Should be rendered as:
// Baz
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 509, "Inlines Links");
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 510, "Inlines Links");
TestParser.TestSpec("[Foo\n bar]: /url\n\n[Baz][Foo bar]", "Baz
", "");
}
}
@@ -13503,9 +13533,9 @@ namespace Markdig.Tests
public partial class TestInlinesLinks
{
[Test]
- public void Example510()
+ public void Example511()
{
- // Example 510
+ // Example 511
// Section: Inlines Links
//
// The following CommonMark:
@@ -13516,7 +13546,7 @@ namespace Markdig.Tests
// Should be rendered as:
// [foo] bar
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 510, "Inlines Links");
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 511, "Inlines Links");
TestParser.TestSpec("[foo] [bar]\n\n[bar]: /url \"title\"", "[foo] bar
", "");
}
}
@@ -13524,9 +13554,9 @@ namespace Markdig.Tests
public partial class TestInlinesLinks
{
[Test]
- public void Example511()
+ public void Example512()
{
- // Example 511
+ // Example 512
// Section: Inlines Links
//
// The following CommonMark:
@@ -13539,7 +13569,7 @@ namespace Markdig.Tests
// [foo]
// bar
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 511, "Inlines Links");
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 512, "Inlines Links");
TestParser.TestSpec("[foo]\n[bar]\n\n[bar]: /url \"title\"", "[foo]\nbar
", "");
}
}
@@ -13576,9 +13606,9 @@ namespace Markdig.Tests
public partial class TestInlinesLinks
{
[Test]
- public void Example512()
+ public void Example513()
{
- // Example 512
+ // Example 513
// Section: Inlines Links
//
// The following CommonMark:
@@ -13591,7 +13621,7 @@ namespace Markdig.Tests
// Should be rendered as:
// bar
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 512, "Inlines Links");
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 513, "Inlines Links");
TestParser.TestSpec("[foo]: /url1\n\n[foo]: /url2\n\n[bar][foo]", "bar
", "");
}
}
@@ -13602,9 +13632,9 @@ namespace Markdig.Tests
public partial class TestInlinesLinks
{
[Test]
- public void Example513()
+ public void Example514()
{
- // Example 513
+ // Example 514
// Section: Inlines Links
//
// The following CommonMark:
@@ -13615,7 +13645,7 @@ namespace Markdig.Tests
// Should be rendered as:
// [bar][foo!]
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 513, "Inlines Links");
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 514, "Inlines Links");
TestParser.TestSpec("[bar][foo\\!]\n\n[foo!]: /url", "[bar][foo!]
", "");
}
}
@@ -13625,9 +13655,9 @@ namespace Markdig.Tests
public partial class TestInlinesLinks
{
[Test]
- public void Example514()
+ public void Example515()
{
- // Example 514
+ // Example 515
// Section: Inlines Links
//
// The following CommonMark:
@@ -13639,30 +13669,8 @@ namespace Markdig.Tests
// [foo][ref[]
// [ref[]: /uri
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 514, "Inlines Links");
- TestParser.TestSpec("[foo][ref[]\n\n[ref[]: /uri", "[foo][ref[]
\n[ref[]: /uri
", "");
- }
- }
- [TestFixture]
- public partial class TestInlinesLinks
- {
- [Test]
- public void Example515()
- {
- // Example 515
- // Section: Inlines Links
- //
- // The following CommonMark:
- // [foo][ref[bar]]
- //
- // [ref[bar]]: /uri
- //
- // Should be rendered as:
- // [foo][ref[bar]]
- // [ref[bar]]: /uri
-
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 515, "Inlines Links");
- TestParser.TestSpec("[foo][ref[bar]]\n\n[ref[bar]]: /uri", "[foo][ref[bar]]
\n[ref[bar]]: /uri
", "");
+ TestParser.TestSpec("[foo][ref[]\n\n[ref[]: /uri", "[foo][ref[]
\n[ref[]: /uri
", "");
}
}
[TestFixture]
@@ -13675,16 +13683,16 @@ namespace Markdig.Tests
// Section: Inlines Links
//
// The following CommonMark:
- // [[[foo]]]
+ // [foo][ref[bar]]
//
- // [[[foo]]]: /url
+ // [ref[bar]]: /uri
//
// Should be rendered as:
- // [[[foo]]]
- // [[[foo]]]: /url
+ // [foo][ref[bar]]
+ // [ref[bar]]: /uri
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 516, "Inlines Links");
- TestParser.TestSpec("[[[foo]]]\n\n[[[foo]]]: /url", "[[[foo]]]
\n[[[foo]]]: /url
", "");
+ TestParser.TestSpec("[foo][ref[bar]]\n\n[ref[bar]]: /uri", "[foo][ref[bar]]
\n[ref[bar]]: /uri
", "");
}
}
[TestFixture]
@@ -13697,18 +13705,18 @@ namespace Markdig.Tests
// Section: Inlines Links
//
// The following CommonMark:
- // [foo][ref\[]
+ // [[[foo]]]
//
- // [ref\[]: /uri
+ // [[[foo]]]: /url
//
// Should be rendered as:
- // foo
+ // [[[foo]]]
+ // [[[foo]]]: /url
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 517, "Inlines Links");
- TestParser.TestSpec("[foo][ref\\[]\n\n[ref\\[]: /uri", "foo
", "");
+ TestParser.TestSpec("[[[foo]]]\n\n[[[foo]]]: /url", "[[[foo]]]
\n[[[foo]]]: /url
", "");
}
}
- // Note that in this example `]` is not backslash-escaped:
[TestFixture]
public partial class TestInlinesLinks
{
@@ -13719,6 +13727,28 @@ namespace Markdig.Tests
// Section: Inlines Links
//
// The following CommonMark:
+ // [foo][ref\[]
+ //
+ // [ref\[]: /uri
+ //
+ // Should be rendered as:
+ // foo
+
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 518, "Inlines Links");
+ TestParser.TestSpec("[foo][ref\\[]\n\n[ref\\[]: /uri", "foo
", "");
+ }
+ }
+ // Note that in this example `]` is not backslash-escaped:
+ [TestFixture]
+ public partial class TestInlinesLinks
+ {
+ [Test]
+ public void Example519()
+ {
+ // Example 519
+ // Section: Inlines Links
+ //
+ // The following CommonMark:
// [bar\\]: /uri
//
// [bar\\]
@@ -13726,7 +13756,7 @@ namespace Markdig.Tests
// Should be rendered as:
// bar\
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 518, "Inlines Links");
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 519, "Inlines Links");
TestParser.TestSpec("[bar\\\\]: /uri\n\n[bar\\\\]", "bar\\
", "");
}
}
@@ -13735,9 +13765,9 @@ namespace Markdig.Tests
public partial class TestInlinesLinks
{
[Test]
- public void Example519()
+ public void Example520()
{
- // Example 519
+ // Example 520
// Section: Inlines Links
//
// The following CommonMark:
@@ -13749,7 +13779,7 @@ namespace Markdig.Tests
// []
// []: /uri
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 519, "Inlines Links");
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 520, "Inlines Links");
TestParser.TestSpec("[]\n\n[]: /uri", "[]
\n[]: /uri
", "");
}
}
@@ -13757,9 +13787,9 @@ namespace Markdig.Tests
public partial class TestInlinesLinks
{
[Test]
- public void Example520()
+ public void Example521()
{
- // Example 520
+ // Example 521
// Section: Inlines Links
//
// The following CommonMark:
@@ -13775,7 +13805,7 @@ namespace Markdig.Tests
// [
// ]: /uri
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 520, "Inlines Links");
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 521, "Inlines Links");
TestParser.TestSpec("[\n ]\n\n[\n ]: /uri", "[\n]
\n[\n]: /uri
", "");
}
}
@@ -13791,9 +13821,9 @@ namespace Markdig.Tests
public partial class TestInlinesLinks
{
[Test]
- public void Example521()
+ public void Example522()
{
- // Example 521
+ // Example 522
// Section: Inlines Links
//
// The following CommonMark:
@@ -13804,34 +13834,12 @@ namespace Markdig.Tests
// Should be rendered as:
// foo
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 521, "Inlines Links");
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 522, "Inlines Links");
TestParser.TestSpec("[foo][]\n\n[foo]: /url \"title\"", "foo
", "");
}
}
[TestFixture]
public partial class TestInlinesLinks
- {
- [Test]
- public void Example522()
- {
- // Example 522
- // Section: Inlines Links
- //
- // The following CommonMark:
- // [*foo* bar][]
- //
- // [*foo* bar]: /url "title"
- //
- // Should be rendered as:
- // foo bar
-
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 522, "Inlines Links");
- TestParser.TestSpec("[*foo* bar][]\n\n[*foo* bar]: /url \"title\"", "foo bar
", "");
- }
- }
- // The link labels are case-insensitive:
- [TestFixture]
- public partial class TestInlinesLinks
{
[Test]
public void Example523()
@@ -13840,6 +13848,28 @@ namespace Markdig.Tests
// Section: Inlines Links
//
// The following CommonMark:
+ // [*foo* bar][]
+ //
+ // [*foo* bar]: /url "title"
+ //
+ // Should be rendered as:
+ // foo bar
+
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 523, "Inlines Links");
+ TestParser.TestSpec("[*foo* bar][]\n\n[*foo* bar]: /url \"title\"", "foo bar
", "");
+ }
+ }
+ // The link labels are case-insensitive:
+ [TestFixture]
+ public partial class TestInlinesLinks
+ {
+ [Test]
+ public void Example524()
+ {
+ // Example 524
+ // Section: Inlines Links
+ //
+ // The following CommonMark:
// [Foo][]
//
// [foo]: /url "title"
@@ -13847,7 +13877,7 @@ namespace Markdig.Tests
// Should be rendered as:
// Foo
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 523, "Inlines Links");
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 524, "Inlines Links");
TestParser.TestSpec("[Foo][]\n\n[foo]: /url \"title\"", "Foo
", "");
}
}
@@ -13857,9 +13887,9 @@ namespace Markdig.Tests
public partial class TestInlinesLinks
{
[Test]
- public void Example524()
+ public void Example525()
{
- // Example 524
+ // Example 525
// Section: Inlines Links
//
// The following CommonMark:
@@ -13872,7 +13902,7 @@ namespace Markdig.Tests
// foo
// []
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 524, "Inlines Links");
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 525, "Inlines Links");
TestParser.TestSpec("[foo] \n[]\n\n[foo]: /url \"title\"", "foo\n[]
", "");
}
}
@@ -13888,9 +13918,9 @@ namespace Markdig.Tests
public partial class TestInlinesLinks
{
[Test]
- public void Example525()
+ public void Example526()
{
- // Example 525
+ // Example 526
// Section: Inlines Links
//
// The following CommonMark:
@@ -13901,29 +13931,8 @@ namespace Markdig.Tests
// Should be rendered as:
// foo
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 525, "Inlines Links");
- TestParser.TestSpec("[foo]\n\n[foo]: /url \"title\"", "foo
", "");
- }
- }
- [TestFixture]
- public partial class TestInlinesLinks
- {
- [Test]
- public void Example526()
- {
- // Example 526
- // Section: Inlines Links
- //
- // The following CommonMark:
- // [*foo* bar]
- //
- // [*foo* bar]: /url "title"
- //
- // Should be rendered as:
- // foo bar
-
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 526, "Inlines Links");
- TestParser.TestSpec("[*foo* bar]\n\n[*foo* bar]: /url \"title\"", "foo bar
", "");
+ TestParser.TestSpec("[foo]\n\n[foo]: /url \"title\"", "foo
", "");
}
}
[TestFixture]
@@ -13936,15 +13945,15 @@ namespace Markdig.Tests
// Section: Inlines Links
//
// The following CommonMark:
- // [[*foo* bar]]
+ // [*foo* bar]
//
// [*foo* bar]: /url "title"
//
// Should be rendered as:
- // [foo bar]
+ // foo bar
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 527, "Inlines Links");
- TestParser.TestSpec("[[*foo* bar]]\n\n[*foo* bar]: /url \"title\"", "[foo bar]
", "");
+ TestParser.TestSpec("[*foo* bar]\n\n[*foo* bar]: /url \"title\"", "foo bar
", "");
}
}
[TestFixture]
@@ -13957,18 +13966,17 @@ namespace Markdig.Tests
// Section: Inlines Links
//
// The following CommonMark:
- // [[bar [foo]
+ // [[*foo* bar]]
//
- // [foo]: /url
+ // [*foo* bar]: /url "title"
//
// Should be rendered as:
- // [[bar foo
+ // [foo bar]
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 528, "Inlines Links");
- TestParser.TestSpec("[[bar [foo]\n\n[foo]: /url", "[[bar foo
", "");
+ TestParser.TestSpec("[[*foo* bar]]\n\n[*foo* bar]: /url \"title\"", "[foo bar]
", "");
}
}
- // The link labels are case-insensitive:
[TestFixture]
public partial class TestInlinesLinks
{
@@ -13979,18 +13987,18 @@ namespace Markdig.Tests
// Section: Inlines Links
//
// The following CommonMark:
- // [Foo]
+ // [[bar [foo]
//
- // [foo]: /url "title"
+ // [foo]: /url
//
// Should be rendered as:
- // Foo
+ // [[bar foo
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 529, "Inlines Links");
- TestParser.TestSpec("[Foo]\n\n[foo]: /url \"title\"", "Foo
", "");
+ TestParser.TestSpec("[[bar [foo]\n\n[foo]: /url", "[[bar foo
", "");
}
}
- // A space after the link text should be preserved:
+ // The link labels are case-insensitive:
[TestFixture]
public partial class TestInlinesLinks
{
@@ -14001,19 +14009,18 @@ namespace Markdig.Tests
// Section: Inlines Links
//
// The following CommonMark:
- // [foo] bar
+ // [Foo]
//
- // [foo]: /url
+ // [foo]: /url "title"
//
// Should be rendered as:
- // foo bar
+ // Foo
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 530, "Inlines Links");
- TestParser.TestSpec("[foo] bar\n\n[foo]: /url", "foo bar
", "");
+ TestParser.TestSpec("[Foo]\n\n[foo]: /url \"title\"", "Foo
", "");
}
}
- // If you just want bracketed text, you can backslash-escape the
- // opening bracket to avoid links:
+ // A space after the link text should be preserved:
[TestFixture]
public partial class TestInlinesLinks
{
@@ -14024,19 +14031,19 @@ namespace Markdig.Tests
// Section: Inlines Links
//
// The following CommonMark:
- // \[foo]
+ // [foo] bar
//
- // [foo]: /url "title"
+ // [foo]: /url
//
// Should be rendered as:
- // [foo]
+ // foo bar
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 531, "Inlines Links");
- TestParser.TestSpec("\\[foo]\n\n[foo]: /url \"title\"", "[foo]
", "");
+ TestParser.TestSpec("[foo] bar\n\n[foo]: /url", "foo bar
", "");
}
}
- // Note that this is a link, because a link label ends with the first
- // following closing bracket:
+ // If you just want bracketed text, you can backslash-escape the
+ // opening bracket to avoid links:
[TestFixture]
public partial class TestInlinesLinks
{
@@ -14047,18 +14054,19 @@ namespace Markdig.Tests
// Section: Inlines Links
//
// The following CommonMark:
- // [foo*]: /url
+ // \[foo]
//
- // *[foo*]
+ // [foo]: /url "title"
//
// Should be rendered as:
- // *foo*
+ // [foo]
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 532, "Inlines Links");
- TestParser.TestSpec("[foo*]: /url\n\n*[foo*]", "*foo*
", "");
+ TestParser.TestSpec("\\[foo]\n\n[foo]: /url \"title\"", "[foo]
", "");
}
}
- // Full references take precedence over shortcut references:
+ // Note that this is a link, because a link label ends with the first
+ // following closing bracket:
[TestFixture]
public partial class TestInlinesLinks
{
@@ -14069,6 +14077,29 @@ namespace Markdig.Tests
// Section: Inlines Links
//
// The following CommonMark:
+ // [foo*]: /url
+ //
+ // *[foo*]
+ //
+ // Should be rendered as:
+ // *foo*
+
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 533, "Inlines Links");
+ TestParser.TestSpec("[foo*]: /url\n\n*[foo*]", "*foo*
", "");
+ }
+ }
+ // Full and compact references take precedence over shortcut
+ // references:
+ [TestFixture]
+ public partial class TestInlinesLinks
+ {
+ [Test]
+ public void Example534()
+ {
+ // Example 534
+ // Section: Inlines Links
+ //
+ // The following CommonMark:
// [foo][bar]
//
// [foo]: /url1
@@ -14077,9 +14108,73 @@ namespace Markdig.Tests
// Should be rendered as:
// foo
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 533, "Inlines Links");
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 534, "Inlines Links");
TestParser.TestSpec("[foo][bar]\n\n[foo]: /url1\n[bar]: /url2", "foo
", "");
}
+ }
+ [TestFixture]
+ public partial class TestInlinesLinks
+ {
+ [Test]
+ public void Example535()
+ {
+ // Example 535
+ // Section: Inlines Links
+ //
+ // The following CommonMark:
+ // [foo][]
+ //
+ // [foo]: /url1
+ //
+ // Should be rendered as:
+ // foo
+
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 535, "Inlines Links");
+ TestParser.TestSpec("[foo][]\n\n[foo]: /url1", "foo
", "");
+ }
+ }
+ // Inline links also take precedence:
+ [TestFixture]
+ public partial class TestInlinesLinks
+ {
+ [Test]
+ public void Example536()
+ {
+ // Example 536
+ // Section: Inlines Links
+ //
+ // The following CommonMark:
+ // [foo]()
+ //
+ // [foo]: /url1
+ //
+ // Should be rendered as:
+ // foo
+
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 536, "Inlines Links");
+ TestParser.TestSpec("[foo]()\n\n[foo]: /url1", "foo
", "");
+ }
+ }
+ [TestFixture]
+ public partial class TestInlinesLinks
+ {
+ [Test]
+ public void Example537()
+ {
+ // Example 537
+ // Section: Inlines Links
+ //
+ // The following CommonMark:
+ // [foo](not a link)
+ //
+ // [foo]: /url1
+ //
+ // Should be rendered as:
+ // foo(not a link)
+
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 537, "Inlines Links");
+ TestParser.TestSpec("[foo](not a link)\n\n[foo]: /url1", "foo(not a link)
", "");
+ }
}
// In the following case `[bar][baz]` is parsed as a reference,
// `[foo]` as normal text:
@@ -14087,9 +14182,9 @@ namespace Markdig.Tests
public partial class TestInlinesLinks
{
[Test]
- public void Example534()
+ public void Example538()
{
- // Example 534
+ // Example 538
// Section: Inlines Links
//
// The following CommonMark:
@@ -14100,7 +14195,7 @@ namespace Markdig.Tests
// Should be rendered as:
// [foo]bar
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 534, "Inlines Links");
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 538, "Inlines Links");
TestParser.TestSpec("[foo][bar][baz]\n\n[baz]: /url", "[foo]bar
", "");
}
}
@@ -14110,9 +14205,9 @@ namespace Markdig.Tests
public partial class TestInlinesLinks
{
[Test]
- public void Example535()
+ public void Example539()
{
- // Example 535
+ // Example 539
// Section: Inlines Links
//
// The following CommonMark:
@@ -14124,7 +14219,7 @@ namespace Markdig.Tests
// Should be rendered as:
// foobaz
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 535, "Inlines Links");
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 539, "Inlines Links");
TestParser.TestSpec("[foo][bar][baz]\n\n[baz]: /url1\n[bar]: /url2", "foobaz
", "");
}
}
@@ -14134,9 +14229,9 @@ namespace Markdig.Tests
public partial class TestInlinesLinks
{
[Test]
- public void Example536()
+ public void Example540()
{
- // Example 536
+ // Example 540
// Section: Inlines Links
//
// The following CommonMark:
@@ -14148,7 +14243,7 @@ namespace Markdig.Tests
// Should be rendered as:
// [foo]bar
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 536, "Inlines Links");
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 540, "Inlines Links");
TestParser.TestSpec("[foo][bar][baz]\n\n[baz]: /url1\n[foo]: /url2", "[foo]bar
", "");
}
}
@@ -14167,9 +14262,9 @@ namespace Markdig.Tests
public partial class TestInlinesImages
{
[Test]
- public void Example537()
+ public void Example541()
{
- // Example 537
+ // Example 541
// Section: Inlines Images
//
// The following CommonMark:
@@ -14178,7 +14273,7 @@ namespace Markdig.Tests
// Should be rendered as:
// 
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 537, "Inlines Images");
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 541, "Inlines Images");
TestParser.TestSpec("", "
", "");
}
}
@@ -14186,9 +14281,9 @@ namespace Markdig.Tests
public partial class TestInlinesImages
{
[Test]
- public void Example538()
+ public void Example542()
{
- // Example 538
+ // Example 542
// Section: Inlines Images
//
// The following CommonMark:
@@ -14199,7 +14294,7 @@ namespace Markdig.Tests
// Should be rendered as:
// 
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 538, "Inlines Images");
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 542, "Inlines Images");
TestParser.TestSpec("![foo *bar*]\n\n[foo *bar*]: train.jpg \"train & tracks\"", "
", "");
}
}
@@ -14207,9 +14302,9 @@ namespace Markdig.Tests
public partial class TestInlinesImages
{
[Test]
- public void Example539()
+ public void Example543()
{
- // Example 539
+ // Example 543
// Section: Inlines Images
//
// The following CommonMark:
@@ -14218,7 +14313,7 @@ namespace Markdig.Tests
// Should be rendered as:
// 
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 539, "Inlines Images");
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 543, "Inlines Images");
TestParser.TestSpec("](/url2)", "
", "");
}
}
@@ -14226,9 +14321,9 @@ namespace Markdig.Tests
public partial class TestInlinesImages
{
[Test]
- public void Example540()
+ public void Example544()
{
- // Example 540
+ // Example 544
// Section: Inlines Images
//
// The following CommonMark:
@@ -14237,7 +14332,7 @@ namespace Markdig.Tests
// Should be rendered as:
// 
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 540, "Inlines Images");
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 544, "Inlines Images");
TestParser.TestSpec("](/url2)", "
", "");
}
}
@@ -14251,9 +14346,9 @@ namespace Markdig.Tests
public partial class TestInlinesImages
{
[Test]
- public void Example541()
+ public void Example545()
{
- // Example 541
+ // Example 545
// Section: Inlines Images
//
// The following CommonMark:
@@ -14264,86 +14359,8 @@ namespace Markdig.Tests
// Should be rendered as:
// 
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 541, "Inlines Images");
- TestParser.TestSpec("![foo *bar*][]\n\n[foo *bar*]: train.jpg \"train & tracks\"", "
", "");
- }
- }
- [TestFixture]
- public partial class TestInlinesImages
- {
- [Test]
- public void Example542()
- {
- // Example 542
- // Section: Inlines Images
- //
- // The following CommonMark:
- // ![foo *bar*][foobar]
- //
- // [FOOBAR]: train.jpg "train & tracks"
- //
- // Should be rendered as:
- // 
-
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 542, "Inlines Images");
- TestParser.TestSpec("![foo *bar*][foobar]\n\n[FOOBAR]: train.jpg \"train & tracks\"", "
", "");
- }
- }
- [TestFixture]
- public partial class TestInlinesImages
- {
- [Test]
- public void Example543()
- {
- // Example 543
- // Section: Inlines Images
- //
- // The following CommonMark:
- // 
- //
- // Should be rendered as:
- // 
-
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 543, "Inlines Images");
- TestParser.TestSpec("", "
", "");
- }
- }
- [TestFixture]
- public partial class TestInlinesImages
- {
- [Test]
- public void Example544()
- {
- // Example 544
- // Section: Inlines Images
- //
- // The following CommonMark:
- // My 
- //
- // Should be rendered as:
- // My 
-
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 544, "Inlines Images");
- TestParser.TestSpec("My ", "My 
", "");
- }
- }
- [TestFixture]
- public partial class TestInlinesImages
- {
- [Test]
- public void Example545()
- {
- // Example 545
- // Section: Inlines Images
- //
- // The following CommonMark:
- // ![foo]()
- //
- // Should be rendered as:
- // 
-
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 545, "Inlines Images");
- TestParser.TestSpec("![foo]()", "
", "");
+ TestParser.TestSpec("![foo *bar*][]\n\n[foo *bar*]: train.jpg \"train & tracks\"", "
", "");
}
}
[TestFixture]
@@ -14356,16 +14373,17 @@ namespace Markdig.Tests
// Section: Inlines Images
//
// The following CommonMark:
- // 
+ // ![foo *bar*][foobar]
+ //
+ // [FOOBAR]: train.jpg "train & tracks"
//
// Should be rendered as:
- // 
+ // 
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 546, "Inlines Images");
- TestParser.TestSpec("", "
", "");
+ TestParser.TestSpec("![foo *bar*][foobar]\n\n[FOOBAR]: train.jpg \"train & tracks\"", "
", "");
}
}
- // Reference-style:
[TestFixture]
public partial class TestInlinesImages
{
@@ -14376,15 +14394,13 @@ namespace Markdig.Tests
// Section: Inlines Images
//
// The following CommonMark:
- // ![foo][bar]
- //
- // [bar]: /url
+ // 
//
// Should be rendered as:
- // 
+ // 
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 547, "Inlines Images");
- TestParser.TestSpec("![foo][bar]\n\n[bar]: /url", "
", "");
+ TestParser.TestSpec("", "
", "");
}
}
[TestFixture]
@@ -14397,18 +14413,15 @@ namespace Markdig.Tests
// Section: Inlines Images
//
// The following CommonMark:
- // ![foo][bar]
- //
- // [BAR]: /url
+ // My 
//
// Should be rendered as:
- // 
+ // My 
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 548, "Inlines Images");
- TestParser.TestSpec("![foo][bar]\n\n[BAR]: /url", "
", "");
+ TestParser.TestSpec("My ", "My 
", "");
}
}
- // Collapsed:
[TestFixture]
public partial class TestInlinesImages
{
@@ -14419,15 +14432,13 @@ namespace Markdig.Tests
// Section: Inlines Images
//
// The following CommonMark:
- // ![foo][]
- //
- // [foo]: /url "title"
+ // ![foo]()
//
// Should be rendered as:
- // 
+ // 
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 549, "Inlines Images");
- TestParser.TestSpec("![foo][]\n\n[foo]: /url \"title\"", "
", "");
+ TestParser.TestSpec("![foo]()", "
", "");
}
}
[TestFixture]
@@ -14440,18 +14451,16 @@ namespace Markdig.Tests
// Section: Inlines Images
//
// The following CommonMark:
- // ![*foo* bar][]
- //
- // [*foo* bar]: /url "title"
+ // 
//
// Should be rendered as:
- // 
+ // 
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 550, "Inlines Images");
- TestParser.TestSpec("![*foo* bar][]\n\n[*foo* bar]: /url \"title\"", "
", "");
+ TestParser.TestSpec("", "
", "");
}
}
- // The labels are case-insensitive:
+ // Reference-style:
[TestFixture]
public partial class TestInlinesImages
{
@@ -14462,19 +14471,17 @@ namespace Markdig.Tests
// Section: Inlines Images
//
// The following CommonMark:
- // ![Foo][]
+ // ![foo][bar]
//
- // [foo]: /url "title"
+ // [bar]: /url
//
// Should be rendered as:
- // 
+ // 
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 551, "Inlines Images");
- TestParser.TestSpec("![Foo][]\n\n[foo]: /url \"title\"", "
", "");
+ TestParser.TestSpec("![foo][bar]\n\n[bar]: /url", "
", "");
}
}
- // As with reference links, [whitespace] is not allowed
- // between the two sets of brackets:
[TestFixture]
public partial class TestInlinesImages
{
@@ -14485,20 +14492,18 @@ namespace Markdig.Tests
// Section: Inlines Images
//
// The following CommonMark:
- // ![foo]
- // []
+ // ![foo][bar]
//
- // [foo]: /url "title"
+ // [BAR]: /url
//
// Should be rendered as:
- //
- // []
+ // 
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 552, "Inlines Images");
- TestParser.TestSpec("![foo] \n[]\n\n[foo]: /url \"title\"", "
\n[]
", "");
+ TestParser.TestSpec("![foo][bar]\n\n[BAR]: /url", "
", "");
}
}
- // Shortcut:
+ // Collapsed:
[TestFixture]
public partial class TestInlinesImages
{
@@ -14509,7 +14514,7 @@ namespace Markdig.Tests
// Section: Inlines Images
//
// The following CommonMark:
- // ![foo]
+ // ![foo][]
//
// [foo]: /url "title"
//
@@ -14517,7 +14522,7 @@ namespace Markdig.Tests
// 
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 553, "Inlines Images");
- TestParser.TestSpec("![foo]\n\n[foo]: /url \"title\"", "
", "");
+ TestParser.TestSpec("![foo][]\n\n[foo]: /url \"title\"", "
", "");
}
}
[TestFixture]
@@ -14530,7 +14535,7 @@ namespace Markdig.Tests
// Section: Inlines Images
//
// The following CommonMark:
- // ![*foo* bar]
+ // ![*foo* bar][]
//
// [*foo* bar]: /url "title"
//
@@ -14538,6 +14543,96 @@ namespace Markdig.Tests
// 
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 554, "Inlines Images");
+ TestParser.TestSpec("![*foo* bar][]\n\n[*foo* bar]: /url \"title\"", "
", "");
+ }
+ }
+ // The labels are case-insensitive:
+ [TestFixture]
+ public partial class TestInlinesImages
+ {
+ [Test]
+ public void Example555()
+ {
+ // Example 555
+ // Section: Inlines Images
+ //
+ // The following CommonMark:
+ // ![Foo][]
+ //
+ // [foo]: /url "title"
+ //
+ // Should be rendered as:
+ // 
+
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 555, "Inlines Images");
+ TestParser.TestSpec("![Foo][]\n\n[foo]: /url \"title\"", "
", "");
+ }
+ }
+ // As with reference links, [whitespace] is not allowed
+ // between the two sets of brackets:
+ [TestFixture]
+ public partial class TestInlinesImages
+ {
+ [Test]
+ public void Example556()
+ {
+ // Example 556
+ // Section: Inlines Images
+ //
+ // The following CommonMark:
+ // ![foo]
+ // []
+ //
+ // [foo]: /url "title"
+ //
+ // Should be rendered as:
+ //
+ // []
+
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 556, "Inlines Images");
+ TestParser.TestSpec("![foo] \n[]\n\n[foo]: /url \"title\"", "
\n[]
", "");
+ }
+ }
+ // Shortcut:
+ [TestFixture]
+ public partial class TestInlinesImages
+ {
+ [Test]
+ public void Example557()
+ {
+ // Example 557
+ // Section: Inlines Images
+ //
+ // The following CommonMark:
+ // ![foo]
+ //
+ // [foo]: /url "title"
+ //
+ // Should be rendered as:
+ // 
+
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 557, "Inlines Images");
+ TestParser.TestSpec("![foo]\n\n[foo]: /url \"title\"", "
", "");
+ }
+ }
+ [TestFixture]
+ public partial class TestInlinesImages
+ {
+ [Test]
+ public void Example558()
+ {
+ // Example 558
+ // Section: Inlines Images
+ //
+ // The following CommonMark:
+ // ![*foo* bar]
+ //
+ // [*foo* bar]: /url "title"
+ //
+ // Should be rendered as:
+ // 
+
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 558, "Inlines Images");
TestParser.TestSpec("![*foo* bar]\n\n[*foo* bar]: /url \"title\"", "
", "");
}
}
@@ -14546,9 +14641,9 @@ namespace Markdig.Tests
public partial class TestInlinesImages
{
[Test]
- public void Example555()
+ public void Example559()
{
- // Example 555
+ // Example 559
// Section: Inlines Images
//
// The following CommonMark:
@@ -14560,7 +14655,7 @@ namespace Markdig.Tests
// ![[foo]]
// [[foo]]: /url "title"
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 555, "Inlines Images");
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 559, "Inlines Images");
TestParser.TestSpec("![[foo]]\n\n[[foo]]: /url \"title\"", "![[foo]]
\n[[foo]]: /url "title"
", "");
}
}
@@ -14569,9 +14664,9 @@ namespace Markdig.Tests
public partial class TestInlinesImages
{
[Test]
- public void Example556()
+ public void Example560()
{
- // Example 556
+ // Example 560
// Section: Inlines Images
//
// The following CommonMark:
@@ -14582,7 +14677,7 @@ namespace Markdig.Tests
// Should be rendered as:
// 
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 556, "Inlines Images");
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 560, "Inlines Images");
TestParser.TestSpec("![Foo]\n\n[foo]: /url \"title\"", "
", "");
}
}
@@ -14592,9 +14687,9 @@ namespace Markdig.Tests
public partial class TestInlinesImages
{
[Test]
- public void Example557()
+ public void Example561()
{
- // Example 557
+ // Example 561
// Section: Inlines Images
//
// The following CommonMark:
@@ -14605,7 +14700,7 @@ namespace Markdig.Tests
// Should be rendered as:
// ![foo]
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 557, "Inlines Images");
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 561, "Inlines Images");
TestParser.TestSpec("\\!\\[foo]\n\n[foo]: /url \"title\"", "![foo]
", "");
}
}
@@ -14615,9 +14710,9 @@ namespace Markdig.Tests
public partial class TestInlinesImages
{
[Test]
- public void Example558()
+ public void Example562()
{
- // Example 558
+ // Example 562
// Section: Inlines Images
//
// The following CommonMark:
@@ -14628,7 +14723,7 @@ namespace Markdig.Tests
// Should be rendered as:
// !foo
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 558, "Inlines Images");
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 562, "Inlines Images");
TestParser.TestSpec("\\![foo]\n\n[foo]: /url \"title\"", "!foo
", "");
}
}
@@ -14659,9 +14754,9 @@ namespace Markdig.Tests
public partial class TestInlinesAutolinks
{
[Test]
- public void Example559()
+ public void Example563()
{
- // Example 559
+ // Example 563
// Section: Inlines Autolinks
//
// The following CommonMark:
@@ -14670,89 +14765,8 @@ namespace Markdig.Tests
// Should be rendered as:
// http://foo.bar.baz
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 559, "Inlines Autolinks");
- TestParser.TestSpec("", "http://foo.bar.baz
", "");
- }
- }
- [TestFixture]
- public partial class TestInlinesAutolinks
- {
- [Test]
- public void Example560()
- {
- // Example 560
- // Section: Inlines Autolinks
- //
- // The following CommonMark:
- //
- //
- // Should be rendered as:
- // http://foo.bar.baz/test?q=hello&id=22&boolean
-
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 560, "Inlines Autolinks");
- TestParser.TestSpec("", "http://foo.bar.baz/test?q=hello&id=22&boolean
", "");
- }
- }
- [TestFixture]
- public partial class TestInlinesAutolinks
- {
- [Test]
- public void Example561()
- {
- // Example 561
- // Section: Inlines Autolinks
- //
- // The following CommonMark:
- //
- //
- // Should be rendered as:
- // irc://foo.bar:2233/baz
-
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 561, "Inlines Autolinks");
- TestParser.TestSpec("", "irc://foo.bar:2233/baz
", "");
- }
- }
- // Uppercase is also fine:
- [TestFixture]
- public partial class TestInlinesAutolinks
- {
- [Test]
- public void Example562()
- {
- // Example 562
- // Section: Inlines Autolinks
- //
- // The following CommonMark:
- //
- //
- // Should be rendered as:
- // MAILTO:FOO@BAR.BAZ
-
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 562, "Inlines Autolinks");
- TestParser.TestSpec("", "MAILTO:FOO@BAR.BAZ
", "");
- }
- }
- // Note that many strings that count as [absolute URIs] for
- // purposes of this spec are not valid URIs, because their
- // schemes are not registered or because of other problems
- // with their syntax:
- [TestFixture]
- public partial class TestInlinesAutolinks
- {
- [Test]
- public void Example563()
- {
- // Example 563
- // Section: Inlines Autolinks
- //
- // The following CommonMark:
- //
- //
- // Should be rendered as:
- // a+b+c:d
-
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 563, "Inlines Autolinks");
- TestParser.TestSpec("", "a+b+c:d
", "");
+ TestParser.TestSpec("", "http://foo.bar.baz
", "");
}
}
[TestFixture]
@@ -14765,13 +14779,13 @@ namespace Markdig.Tests
// Section: Inlines Autolinks
//
// The following CommonMark:
- //
+ //
//
// Should be rendered as:
- // made-up-scheme://foo,bar
+ // http://foo.bar.baz/test?q=hello&id=22&boolean
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 564, "Inlines Autolinks");
- TestParser.TestSpec("", "made-up-scheme://foo,bar
", "");
+ TestParser.TestSpec("", "http://foo.bar.baz/test?q=hello&id=22&boolean
", "");
}
}
[TestFixture]
@@ -14784,15 +14798,16 @@ namespace Markdig.Tests
// Section: Inlines Autolinks
//
// The following CommonMark:
- //
+ //
//
// Should be rendered as:
- // http://../
+ // irc://foo.bar:2233/baz
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 565, "Inlines Autolinks");
- TestParser.TestSpec("", "http://../
", "");
+ TestParser.TestSpec("", "irc://foo.bar:2233/baz
", "");
}
}
+ // Uppercase is also fine:
[TestFixture]
public partial class TestInlinesAutolinks
{
@@ -14803,16 +14818,19 @@ namespace Markdig.Tests
// Section: Inlines Autolinks
//
// The following CommonMark:
- //
+ //
//
// Should be rendered as:
- // localhost:5001/foo
+ // MAILTO:FOO@BAR.BAZ
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 566, "Inlines Autolinks");
- TestParser.TestSpec("", "localhost:5001/foo
", "");
+ TestParser.TestSpec("", "MAILTO:FOO@BAR.BAZ
", "");
}
}
- // Spaces are not allowed in autolinks:
+ // Note that many strings that count as [absolute URIs] for
+ // purposes of this spec are not valid URIs, because their
+ // schemes are not registered or because of other problems
+ // with their syntax:
[TestFixture]
public partial class TestInlinesAutolinks
{
@@ -14823,16 +14841,15 @@ namespace Markdig.Tests
// Section: Inlines Autolinks
//
// The following CommonMark:
- //
+ //
//
// Should be rendered as:
- // <http://foo.bar/baz bim>
+ // a+b+c:d
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 567, "Inlines Autolinks");
- TestParser.TestSpec("", "<http://foo.bar/baz bim>
", "");
+ TestParser.TestSpec("", "a+b+c:d
", "");
}
}
- // Backslash-escapes do not work inside autolinks:
[TestFixture]
public partial class TestInlinesAutolinks
{
@@ -14843,12 +14860,90 @@ namespace Markdig.Tests
// Section: Inlines Autolinks
//
// The following CommonMark:
+ //
+ //
+ // Should be rendered as:
+ // made-up-scheme://foo,bar
+
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 568, "Inlines Autolinks");
+ TestParser.TestSpec("", "made-up-scheme://foo,bar
", "");
+ }
+ }
+ [TestFixture]
+ public partial class TestInlinesAutolinks
+ {
+ [Test]
+ public void Example569()
+ {
+ // Example 569
+ // Section: Inlines Autolinks
+ //
+ // The following CommonMark:
+ //
+ //
+ // Should be rendered as:
+ // http://../
+
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 569, "Inlines Autolinks");
+ TestParser.TestSpec("", "http://../
", "");
+ }
+ }
+ [TestFixture]
+ public partial class TestInlinesAutolinks
+ {
+ [Test]
+ public void Example570()
+ {
+ // Example 570
+ // Section: Inlines Autolinks
+ //
+ // The following CommonMark:
+ //
+ //
+ // Should be rendered as:
+ // localhost:5001/foo
+
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 570, "Inlines Autolinks");
+ TestParser.TestSpec("", "localhost:5001/foo
", "");
+ }
+ }
+ // Spaces are not allowed in autolinks:
+ [TestFixture]
+ public partial class TestInlinesAutolinks
+ {
+ [Test]
+ public void Example571()
+ {
+ // Example 571
+ // Section: Inlines Autolinks
+ //
+ // The following CommonMark:
+ //
+ //
+ // Should be rendered as:
+ // <http://foo.bar/baz bim>
+
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 571, "Inlines Autolinks");
+ TestParser.TestSpec("", "<http://foo.bar/baz bim>
", "");
+ }
+ }
+ // Backslash-escapes do not work inside autolinks:
+ [TestFixture]
+ public partial class TestInlinesAutolinks
+ {
+ [Test]
+ public void Example572()
+ {
+ // Example 572
+ // Section: Inlines Autolinks
+ //
+ // The following CommonMark:
//
//
// Should be rendered as:
// http://example.com/\[\
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 568, "Inlines Autolinks");
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 572, "Inlines Autolinks");
TestParser.TestSpec("", "http://example.com/\\[\\
", "");
}
}
@@ -14870,9 +14965,9 @@ namespace Markdig.Tests
public partial class TestInlinesAutolinks
{
[Test]
- public void Example569()
+ public void Example573()
{
- // Example 569
+ // Example 573
// Section: Inlines Autolinks
//
// The following CommonMark:
@@ -14881,86 +14976,8 @@ namespace Markdig.Tests
// Should be rendered as:
// foo@bar.example.com
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 569, "Inlines Autolinks");
- TestParser.TestSpec("", "foo@bar.example.com
", "");
- }
- }
- [TestFixture]
- public partial class TestInlinesAutolinks
- {
- [Test]
- public void Example570()
- {
- // Example 570
- // Section: Inlines Autolinks
- //
- // The following CommonMark:
- //
- //
- // Should be rendered as:
- // foo+special@Bar.baz-bar0.com
-
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 570, "Inlines Autolinks");
- TestParser.TestSpec("", "foo+special@Bar.baz-bar0.com
", "");
- }
- }
- // Backslash-escapes do not work inside email autolinks:
- [TestFixture]
- public partial class TestInlinesAutolinks
- {
- [Test]
- public void Example571()
- {
- // Example 571
- // Section: Inlines Autolinks
- //
- // The following CommonMark:
- //
- //
- // Should be rendered as:
- // <foo+@bar.example.com>
-
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 571, "Inlines Autolinks");
- TestParser.TestSpec("", "<foo+@bar.example.com>
", "");
- }
- }
- // These are not autolinks:
- [TestFixture]
- public partial class TestInlinesAutolinks
- {
- [Test]
- public void Example572()
- {
- // Example 572
- // Section: Inlines Autolinks
- //
- // The following CommonMark:
- // <>
- //
- // Should be rendered as:
- // <>
-
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 572, "Inlines Autolinks");
- TestParser.TestSpec("<>", "<>
", "");
- }
- }
- [TestFixture]
- public partial class TestInlinesAutolinks
- {
- [Test]
- public void Example573()
- {
- // Example 573
- // Section: Inlines Autolinks
- //
- // The following CommonMark:
- // < http://foo.bar >
- //
- // Should be rendered as:
- // < http://foo.bar >
-
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 573, "Inlines Autolinks");
- TestParser.TestSpec("< http://foo.bar >", "< http://foo.bar >
", "");
+ TestParser.TestSpec("", "foo@bar.example.com
", "");
}
}
[TestFixture]
@@ -14973,15 +14990,16 @@ namespace Markdig.Tests
// Section: Inlines Autolinks
//
// The following CommonMark:
- //
+ //
//
// Should be rendered as:
- // <m:abc>
+ // foo+special@Bar.baz-bar0.com
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 574, "Inlines Autolinks");
- TestParser.TestSpec("", "<m:abc>
", "");
+ TestParser.TestSpec("", "foo+special@Bar.baz-bar0.com
", "");
}
}
+ // Backslash-escapes do not work inside email autolinks:
[TestFixture]
public partial class TestInlinesAutolinks
{
@@ -14992,15 +15010,16 @@ namespace Markdig.Tests
// Section: Inlines Autolinks
//
// The following CommonMark:
- //
+ //
//
// Should be rendered as:
- // <foo.bar.baz>
+ // <foo+@bar.example.com>
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 575, "Inlines Autolinks");
- TestParser.TestSpec("", "<foo.bar.baz>
", "");
+ TestParser.TestSpec("", "<foo+@bar.example.com>
", "");
}
}
+ // These are not autolinks:
[TestFixture]
public partial class TestInlinesAutolinks
{
@@ -15011,13 +15030,13 @@ namespace Markdig.Tests
// Section: Inlines Autolinks
//
// The following CommonMark:
- // http://example.com
+ // <>
//
// Should be rendered as:
- // http://example.com
+ // <>
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 576, "Inlines Autolinks");
- TestParser.TestSpec("http://example.com", "http://example.com
", "");
+ TestParser.TestSpec("<>", "<>
", "");
}
}
[TestFixture]
@@ -15030,12 +15049,88 @@ namespace Markdig.Tests
// Section: Inlines Autolinks
//
// The following CommonMark:
+ // < http://foo.bar >
+ //
+ // Should be rendered as:
+ // < http://foo.bar >
+
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 577, "Inlines Autolinks");
+ TestParser.TestSpec("< http://foo.bar >", "< http://foo.bar >
", "");
+ }
+ }
+ [TestFixture]
+ public partial class TestInlinesAutolinks
+ {
+ [Test]
+ public void Example578()
+ {
+ // Example 578
+ // Section: Inlines Autolinks
+ //
+ // The following CommonMark:
+ //
+ //
+ // Should be rendered as:
+ // <m:abc>
+
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 578, "Inlines Autolinks");
+ TestParser.TestSpec("", "<m:abc>
", "");
+ }
+ }
+ [TestFixture]
+ public partial class TestInlinesAutolinks
+ {
+ [Test]
+ public void Example579()
+ {
+ // Example 579
+ // Section: Inlines Autolinks
+ //
+ // The following CommonMark:
+ //
+ //
+ // Should be rendered as:
+ // <foo.bar.baz>
+
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 579, "Inlines Autolinks");
+ TestParser.TestSpec("", "<foo.bar.baz>
", "");
+ }
+ }
+ [TestFixture]
+ public partial class TestInlinesAutolinks
+ {
+ [Test]
+ public void Example580()
+ {
+ // Example 580
+ // Section: Inlines Autolinks
+ //
+ // The following CommonMark:
+ // http://example.com
+ //
+ // Should be rendered as:
+ // http://example.com
+
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 580, "Inlines Autolinks");
+ TestParser.TestSpec("http://example.com", "http://example.com
", "");
+ }
+ }
+ [TestFixture]
+ public partial class TestInlinesAutolinks
+ {
+ [Test]
+ public void Example581()
+ {
+ // Example 581
+ // Section: Inlines Autolinks
+ //
+ // The following CommonMark:
// foo@bar.example.com
//
// Should be rendered as:
// foo@bar.example.com
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 577, "Inlines Autolinks");
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 581, "Inlines Autolinks");
TestParser.TestSpec("foo@bar.example.com", "foo@bar.example.com
", "");
}
}
@@ -15117,9 +15212,9 @@ namespace Markdig.Tests
public partial class TestInlinesRawHTML
{
[Test]
- public void Example578()
+ public void Example582()
{
- // Example 578
+ // Example 582
// Section: Inlines Raw HTML
//
// The following CommonMark:
@@ -15128,97 +15223,13 @@ namespace Markdig.Tests
// Should be rendered as:
//
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 578, "Inlines Raw HTML");
+ Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 582, "Inlines Raw HTML");
TestParser.TestSpec("", "
", "");
}
}
// Empty elements:
[TestFixture]
public partial class TestInlinesRawHTML
- {
- [Test]
- public void Example579()
- {
- // Example 579
- // Section: Inlines Raw HTML
- //
- // The following CommonMark:
- //
- //
- // Should be rendered as:
- //
-
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 579, "Inlines Raw HTML");
- TestParser.TestSpec("", "
", "");
- }
- }
- // [Whitespace] is allowed:
- [TestFixture]
- public partial class TestInlinesRawHTML
- {
- [Test]
- public void Example580()
- {
- // Example 580
- // Section: Inlines Raw HTML
- //
- // The following CommonMark:
- //
- //
- // Should be rendered as:
- //
-
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 580, "Inlines Raw HTML");
- TestParser.TestSpec("", "
", "");
- }
- }
- // With attributes:
- [TestFixture]
- public partial class TestInlinesRawHTML
- {
- [Test]
- public void Example581()
- {
- // Example 581
- // Section: Inlines Raw HTML
- //
- // The following CommonMark:
- //
- //
- // Should be rendered as:
- //
-
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 581, "Inlines Raw HTML");
- TestParser.TestSpec("", "
", "");
- }
- }
- // Custom tag names can be used:
- [TestFixture]
- public partial class TestInlinesRawHTML
- {
- [Test]
- public void Example582()
- {
- // Example 582
- // Section: Inlines Raw HTML
- //
- // The following CommonMark:
- // Foo
- //
- // Should be rendered as:
- // Foo
-
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 582, "Inlines Raw HTML");
- TestParser.TestSpec("Foo ", "Foo
", "");
- }
- }
- // Illegal tag names, not parsed as HTML:
- [TestFixture]
- public partial class TestInlinesRawHTML
{
[Test]
public void Example583()
@@ -15227,16 +15238,16 @@ namespace Markdig.Tests
// Section: Inlines Raw HTML
//
// The following CommonMark:
- // <33> <__>
+ //
//
// Should be rendered as:
- // <33> <__>
+ //
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 583, "Inlines Raw HTML");
- TestParser.TestSpec("<33> <__>", "<33> <__>
", "");
+ TestParser.TestSpec("", "
", "");
}
}
- // Illegal attribute names:
+ // [Whitespace] is allowed:
[TestFixture]
public partial class TestInlinesRawHTML
{
@@ -15247,16 +15258,18 @@ namespace Markdig.Tests
// Section: Inlines Raw HTML
//
// The following CommonMark:
- //
+ //
//
// Should be rendered as:
- // <a h*#ref="hi">
+ //
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 584, "Inlines Raw HTML");
- TestParser.TestSpec("", "<a h*#ref="hi">
", "");
+ TestParser.TestSpec("", "
", "");
}
}
- // Illegal attribute values:
+ // With attributes:
[TestFixture]
public partial class TestInlinesRawHTML
{
@@ -15267,16 +15280,18 @@ namespace Markdig.Tests
// Section: Inlines Raw HTML
//
// The following CommonMark:
- //
//
// Should be rendered as:
- // <a href="hi'> <a href=hi'>
+ //
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 585, "Inlines Raw HTML");
- TestParser.TestSpec(" ", "<a href="hi'> <a href=hi'>
", "");
+ TestParser.TestSpec("", "
", "");
}
}
- // Illegal [whitespace]:
+ // Custom tag names can be used:
[TestFixture]
public partial class TestInlinesRawHTML
{
@@ -15287,18 +15302,16 @@ namespace Markdig.Tests
// Section: Inlines Raw HTML
//
// The following CommonMark:
- // < a><
- // foo>
+ // Foo
//
// Should be rendered as:
- // < a><
- // foo><bar/ >
+ // Foo
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 586, "Inlines Raw HTML");
- TestParser.TestSpec("< a><\nfoo>", "< a><\nfoo><bar/ >
", "");
+ TestParser.TestSpec("Foo ", "Foo
", "");
}
}
- // Missing [whitespace]:
+ // Illegal tag names, not parsed as HTML:
[TestFixture]
public partial class TestInlinesRawHTML
{
@@ -15309,16 +15322,16 @@ namespace Markdig.Tests
// Section: Inlines Raw HTML
//
// The following CommonMark:
- //
+ // <33> <__>
//
// Should be rendered as:
- // <a href='bar'title=title>
+ // <33> <__>
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 587, "Inlines Raw HTML");
- TestParser.TestSpec("", "<a href='bar'title=title>
", "");
+ TestParser.TestSpec("<33> <__>", "<33> <__>
", "");
}
}
- // Closing tags:
+ // Illegal attribute names:
[TestFixture]
public partial class TestInlinesRawHTML
{
@@ -15329,16 +15342,16 @@ namespace Markdig.Tests
// Section: Inlines Raw HTML
//
// The following CommonMark:
- //
+ //
//
// Should be rendered as:
- //