Skip to content

Commit

Permalink
Add GenericAttributes test for xoofx#182
Browse files Browse the repository at this point in the history
  • Loading branch information
MihaZupan committed Aug 1, 2019
1 parent b411522 commit b1cfcf2
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
25 changes: 24 additions & 1 deletion src/Markdig.Tests/Specs/GenericAttributesSpecs.generated.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated: 2019-04-05 16:06:14
// Generated: 2019-08-01 13:57:17

// --------------------------------
// Generic Attributes
Expand Down Expand Up @@ -79,5 +79,28 @@ public void ExtensionsGenericAttributes_Example002()
Console.WriteLine("Example 2\nSection Extensions / Generic Attributes\n");
TestParser.TestSpec("{#fenced-id .fenced-class}\n~~~\nThis is a fenced with attached attributes\n~~~ ", "<pre><code id=\"fenced-id\" class=\"fenced-class\">This is a fenced with attached attributes\n</code></pre>", "attributes|advanced");
}

// Attribute values can be one character long
[Test]
public void ExtensionsGenericAttributes_Example003()
{
// Example 3
// Section: Extensions / Generic Attributes
//
// The following Markdown:
// [Foo](url){data-x=1}
//
// [Foo](url){data-x='1'}
//
// [Foo](url){data-x=11}
//
// Should be rendered as:
// <p><a href="url" data-x="1">Foo</a></p>
// <p><a href="url" data-x="1">Foo</a></p>
// <p><a href="url" data-x="11">Foo</a></p>

Console.WriteLine("Example 3\nSection Extensions / Generic Attributes\n");
TestParser.TestSpec("[Foo](url){data-x=1}\n\n[Foo](url){data-x='1'}\n\n[Foo](url){data-x=11}", "<p><a href=\"url\" data-x=\"1\">Foo</a></p>\n<p><a href=\"url\" data-x=\"1\">Foo</a></p>\n<p><a href=\"url\" data-x=\"11\">Foo</a></p>", "attributes|advanced");
}
}
}
14 changes: 14 additions & 0 deletions src/Markdig.Tests/Specs/GenericAttributesSpecs.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,17 @@ This is a fenced with attached attributes
<pre><code id="fenced-id" class="fenced-class">This is a fenced with attached attributes
</code></pre>
````````````````````````````````

Attribute values can be one character long

```````````````````````````````` example
[Foo](url){data-x=1}
[Foo](url){data-x='1'}
[Foo](url){data-x=11}
.
<p><a href="url" data-x="1">Foo</a></p>
<p><a href="url" data-x="1">Foo</a></p>
<p><a href="url" data-x="11">Foo</a></p>
````````````````````````````````

0 comments on commit b1cfcf2

Please sign in to comment.