Skip to content

Commit 3cb3efd

Browse files
committed
Update EmojiSpecs.md
1 parent 2b74788 commit 3cb3efd

3 files changed

Lines changed: 107 additions & 7 deletions

File tree

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

Lines changed: 63 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ public void ExtensionsEmoji_Example001()
3030
// Should be rendered as:
3131
// <p>This is a test with a 😃 and a 😠 smiley</p>
3232

33-
TestParser.TestSpec("This is a test with a :) and a :angry: smiley", "<p>This is a test with a 😃 and a 😠 smiley</p>", "emojis|advanced+emojis", context: "Example 1\nSection Extensions / Emoji\n");
33+
TestParser.TestSpec("This is a test with a :) and a :angry: smiley", "<p>This is a test with a 😃 and a 😠 smiley</p>", "pipetables+emojis|advanced+emojis", context: "Example 1\nSection Extensions / Emoji\n");
3434
}
3535

36-
// An emoji needs to be preceded by a space:
36+
// An emoji must not be preceded by a letter or digit:
3737
[Test]
3838
public void ExtensionsEmoji_Example002()
3939
{
@@ -46,7 +46,7 @@ public void ExtensionsEmoji_Example002()
4646
// Should be rendered as:
4747
// <p>These are not:) an emoji with a:) x:angry:x</p>
4848

49-
TestParser.TestSpec("These are not:) an emoji with a:) x:angry:x", "<p>These are not:) an emoji with a:) x:angry:x</p>", "emojis|advanced+emojis", context: "Example 2\nSection Extensions / Emoji\n");
49+
TestParser.TestSpec("These are not:) an emoji with a:) x:angry:x", "<p>These are not:) an emoji with a:) x:angry:x</p>", "pipetables+emojis|advanced+emojis", context: "Example 2\nSection Extensions / Emoji\n");
5050
}
5151

5252
// Emojis can be followed by close punctuation (or any other characters):
@@ -62,7 +62,7 @@ public void ExtensionsEmoji_Example003()
6262
// Should be rendered as:
6363
// <p>We all need 😃, it makes us 💪. (and 👌).</p>
6464

65-
TestParser.TestSpec("We all need :), it makes us :muscle:. (and :ok_hand:).", "<p>We all need 😃, it makes us 💪. (and 👌).</p>", "emojis|advanced+emojis", context: "Example 3\nSection Extensions / Emoji\n");
65+
TestParser.TestSpec("We all need :), it makes us :muscle:. (and :ok_hand:).", "<p>We all need 😃, it makes us 💪. (and 👌).</p>", "pipetables+emojis|advanced+emojis", context: "Example 3\nSection Extensions / Emoji\n");
6666
}
6767

6868
// Sentences can end with emojis:
@@ -80,7 +80,65 @@ public void ExtensionsEmoji_Example004()
8080
// <p>This is a sentence 👌
8181
// and keeps going to the next line 😃</p>
8282

83-
TestParser.TestSpec("This is a sentence :ok_hand:\nand keeps going to the next line :)", "<p>This is a sentence 👌\nand keeps going to the next line 😃</p>", "emojis|advanced+emojis", context: "Example 4\nSection Extensions / Emoji\n");
83+
TestParser.TestSpec("This is a sentence :ok_hand:\nand keeps going to the next line :)", "<p>This is a sentence 👌\nand keeps going to the next line 😃</p>", "pipetables+emojis|advanced+emojis", context: "Example 4\nSection Extensions / Emoji\n");
84+
}
85+
86+
// Emojis are rendered inside pipe table cells with surrounding spaces:
87+
[Test]
88+
public void ExtensionsEmoji_Example005()
89+
{
90+
// Example 5
91+
// Section: Extensions / Emoji
92+
//
93+
// The following Markdown:
94+
// | header |
95+
// |--------|
96+
// | :x: |
97+
//
98+
// Should be rendered as:
99+
// <table>
100+
// <thead>
101+
// <tr>
102+
// <th>header</th>
103+
// </tr>
104+
// </thead>
105+
// <tbody>
106+
// <tr>
107+
// <td>❌</td>
108+
// </tr>
109+
// </tbody>
110+
// </table>
111+
112+
TestParser.TestSpec("| header |\n|--------|\n| :x: |", "<table>\n<thead>\n<tr>\n<th>header</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>❌</td>\n</tr>\n</tbody>\n</table>", "pipetables+emojis|advanced+emojis", context: "Example 5\nSection Extensions / Emoji\n");
113+
}
114+
115+
// Emojis are rendered inside pipe table cells without surrounding spaces:
116+
[Test]
117+
public void ExtensionsEmoji_Example006()
118+
{
119+
// Example 6
120+
// Section: Extensions / Emoji
121+
//
122+
// The following Markdown:
123+
// | header |
124+
// |--------|
125+
// |:x:|
126+
//
127+
// Should be rendered as:
128+
// <table>
129+
// <thead>
130+
// <tr>
131+
// <th>header</th>
132+
// </tr>
133+
// </thead>
134+
// <tbody>
135+
// <tr>
136+
// <td>❌</td>
137+
// </tr>
138+
// </tbody>
139+
// </table>
140+
141+
TestParser.TestSpec("| header |\n|--------|\n|:x:|", "<table>\n<thead>\n<tr>\n<th>header</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>❌</td>\n</tr>\n</tbody>\n</table>", "pipetables+emojis|advanced+emojis", context: "Example 6\nSection Extensions / Emoji\n");
84142
}
85143
}
86144
}

src/Markdig.Tests/Specs/EmojiSpecs.md

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This is a test with a :) and a :angry: smiley
1212
<p>This is a test with a 😃 and a 😠 smiley</p>
1313
````````````````````````````````
1414

15-
An emoji needs to be preceded by a space:
15+
An emoji must not be preceded by a letter or digit:
1616

1717
```````````````````````````````` example
1818
These are not:) an emoji with a:) x:angry:x
@@ -37,3 +37,45 @@ and keeps going to the next line :)
3737
<p>This is a sentence 👌
3838
and keeps going to the next line 😃</p>
3939
````````````````````````````````
40+
41+
Emojis are rendered inside pipe table cells with surrounding spaces:
42+
43+
```````````````````````````````` example
44+
| header |
45+
|--------|
46+
| :x: |
47+
.
48+
<table>
49+
<thead>
50+
<tr>
51+
<th>header</th>
52+
</tr>
53+
</thead>
54+
<tbody>
55+
<tr>
56+
<td>❌</td>
57+
</tr>
58+
</tbody>
59+
</table>
60+
````````````````````````````````
61+
62+
Emojis are rendered inside pipe table cells without surrounding spaces:
63+
64+
```````````````````````````````` example
65+
| header |
66+
|--------|
67+
|:x:|
68+
.
69+
<table>
70+
<thead>
71+
<tr>
72+
<th>header</th>
73+
</tr>
74+
</thead>
75+
<tbody>
76+
<tr>
77+
<td>❌</td>
78+
</tr>
79+
</tbody>
80+
</table>
81+
````````````````````````````````

src/SpecFileGen/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public RoundtripSpec(string name, string fileName, string extensions)
7171
new Spec("Grid Tables", "GridTableSpecs.md", "gridtables|advanced"),
7272
new Spec("Custom Containers", "CustomContainerSpecs.md", "customcontainers+attributes|advanced"),
7373
new Spec("Definition Lists", "DefinitionListSpecs.md", "definitionlists+attributes|advanced"),
74-
new Spec("Emoji", "EmojiSpecs.md", "emojis|advanced+emojis"),
74+
new Spec("Emoji", "EmojiSpecs.md", "pipetables+emojis|advanced+emojis"),
7575
new Spec("Abbreviations", "AbbreviationSpecs.md", "abbreviations|advanced"),
7676
new Spec("List Extras", "ListExtraSpecs.md", "listextras|advanced"),
7777
new Spec("Math", "MathSpecs.md", "mathematics|advanced"),

0 commit comments

Comments
 (0)