Skip to content

Commit feca1cd

Browse files
committed
test: Add test for emoji in anchor body
1 parent 21aec01 commit feca1cd

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

test/integration/__snapshots__/emoji.test.js.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ exports[`Emoji Ignores all emoji shorthand codes (noEmoji:true) 1`] = `"<p>:smil
44

55
exports[`Emoji Ignores emoji shorthand codes in URIs 1`] = `"<p>Url <a href=\\"https://docsify.js.org/:foo:/\\" target=\\"_blank\\" rel=\\"noopener\\">https://docsify.js.org/:foo:/</a> <a href=\\"http://docsify.js.org/:100:/\\" target=\\"_blank\\" rel=\\"noopener\\">http://docsify.js.org/:100:/</a> <a href=\\"ftp://docsify.js.org/:smile:/\\" target=\\"_blank\\" rel=\\"noopener\\">ftp://docsify.js.org/:smile:/</a></p>"`;
66
7+
exports[`Emoji Ignores emoji shorthand codes in URIs while handling anchor content 1`] = `"<p>Achor tags <a href=\\"http://docsify.js.org/:100:/\\" target=\\"_blank\\" rel=\\"noopener\\"><img src=\\"https://github.githubassets.com/images/icons/emoji/unicode/1f4af.png?v8.png\\" alt=\\"100\\" class=\\"emoji\\" loading=\\"lazy\\"></a></p>"`;
8+
79
exports[`Emoji Ignores emoji shorthand codes in code, pre, script, and template tags 1`] = `
810
"<pre>:100:</pre>
911

test/integration/emoji.test.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,19 @@ describe('Emoji', function () {
121121
expect(mainElm.innerHTML).toMatchSnapshot();
122122
});
123123

124+
test('Ignores emoji shorthand codes in URIs while handling anchor content', async () => {
125+
await docsifyInit({
126+
markdown: {
127+
homepage: 'Achor tags [:100:](http://docsify.js.org/:100:/)',
128+
},
129+
// _logHTML: true,
130+
});
131+
132+
const mainElm = document.querySelector('#main');
133+
134+
expect(mainElm.innerHTML).toMatchSnapshot();
135+
});
136+
124137
test('Ignores emoji shorthand codes in code, pre, script, and template tags', async () => {
125138
await docsifyInit({
126139
markdown: {

0 commit comments

Comments
 (0)