Skip to content

Commit 7727d6b

Browse files
feat: update emoji url (readmeio#677)
Updates the emoji url to include `/public`.
1 parent 695efe0 commit 7727d6b

7 files changed

+9
-8
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ node_modules
1212

1313
__diff_output__
1414

15-
example/img/emojis
15+
example/public/img/emojis

Makefile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ DOCKER_WORKSPACE := "/markdown"
66
MOUNTS = --volume ${PWD}:${DOCKER_WORKSPACE} \
77
--volume ${DOCKER_WORKSPACE}/node_modules
88

9-
emojis: example/img/emojis ## Install our emojis.
9+
emojis: example/public/img/emojis ## Install our emojis.
1010

11-
example/img/emojis: node_modules/@readme/emojis
11+
example/public/img/emojis: node_modules/@readme/emojis
1212
rm -rf example/img/emojis
13-
mkdir -p example/img/emojis
14-
cp node_modules/@readme/emojis/src/img/*.png example/img/emojis/
13+
rm -rf example/public/img/emojis
14+
mkdir -p example/public/img/emojis
15+
cp node_modules/@readme/emojis/src/img/*.png example/public/img/emojis/
1516

1617
build:
1718
docker build --platform linux/amd64 -t markdown .

__tests__/__snapshots__/index.test.js.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Object {
4848
`;
4949
5050
exports[`emojis 1`] = `
51-
"<p><img src=\\"/img/emojis/joy.png\\" alt=\\":joy:\\" title=\\":joy:\\" class=\\"emoji\\" align=\\"absmiddle\\" height=\\"20\\" width=\\"20\\" caption=\\"\\" loading=\\"lazy\\"><br>
51+
"<p><img src=\\"/public/img/emojis/joy.png\\" alt=\\":joy:\\" title=\\":joy:\\" class=\\"emoji\\" align=\\"absmiddle\\" height=\\"20\\" width=\\"20\\" caption=\\"\\" loading=\\"lazy\\"><br>
5252
<i class=\\"fa fa-lock\\"></i><br>
5353
:unknown-emoji:</p>"
5454
`;
-2.28 KB
Loading
129 KB
Loading

__tests__/gemoji-parser.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ test('should output an image node for a known emoji', () => {
1717
type: 'image',
1818
title: `:${emoji}:`,
1919
alt: `:${emoji}:`,
20-
url: `/img/emojis/${emoji}.png`,
20+
url: `/public/img/emojis/${emoji}.png`,
2121
data: {
2222
hProperties: {
2323
align: 'absmiddle',

processor/parse/gemoji-parser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function tokenize(eat, value, silent) {
3636
type: 'image',
3737
title: `:${subvalue}:`,
3838
alt: `:${subvalue}:`,
39-
url: `/img/emojis/${subvalue}.png`,
39+
url: `/public/img/emojis/${subvalue}.png`,
4040
data: {
4141
hProperties: {
4242
className: 'emoji',

0 commit comments

Comments
 (0)