Skip to content

Commit e8b6a99

Browse files
authored
Revert "feat: Native emoji w/ image-based fallbacks and improved parsing (#1746)"
This reverts commit d50d1a1.
1 parent 80908b9 commit e8b6a99

File tree

18 files changed

+1956
-6092
lines changed

18 files changed

+1956
-6092
lines changed

.codesandbox/ci.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
22
"sandboxes": ["2d17z"],
3-
"packages": [".", "packages/docsify-server-renderer"],
4-
"node": "16"
3+
"packages": [".", "packages/docsify-server-renderer"]
54
}

build/emoji.js

-91
This file was deleted.

docs/_sidebar.md

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
- [Write a Plugin](write-a-plugin.md)
1414
- [Markdown configuration](markdown.md)
1515
- [Language highlighting](language-highlight.md)
16-
- [Emoji](emoji.md)
1716

1817
- Guide
1918

docs/configuration.md

+6-84
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The config can also be defined as a function, in which case the first argument i
1616

1717
```html
1818
<script>
19-
window.$docsify = function (vm) {
19+
window.$docsify = function(vm) {
2020
return {
2121
markdown: {
2222
renderer: {
@@ -319,14 +319,14 @@ window.$docsify = {
319319
markdown: {
320320
smartypants: true,
321321
renderer: {
322-
link: function () {
322+
link: function() {
323323
// ...
324324
},
325325
},
326326
},
327327

328328
// function
329-
markdown: function (marked, renderer) {
329+
markdown: function(marked, renderer) {
330330
// ...
331331
return marked;
332332
},
@@ -398,97 +398,19 @@ window.$docsify = {
398398

399399
Note that if you are running an external script, e.g. an embedded jsfiddle demo, make sure to include the [external-script](plugins.md?id=external-script) plugin.
400400

401-
## nativeEmoji
402-
403-
- type: `Boolean`
404-
- default: `false`
405-
406-
Render emoji shorthand codes using GitHub-style emoji images or platform-native emoji characters.
407-
408-
```js
409-
window.$docsify = {
410-
nativeEmoji: true,
411-
};
412-
```
413-
414-
```markdown
415-
:smile:
416-
:partying_face:
417-
:joy:
418-
:+1:
419-
:-1:
420-
```
421-
422-
GitHub-style images when `false`:
423-
424-
<output data-lang="output">
425-
<img class="emoji" src="https://github.githubassets.com/images/icons/emoji/unicode/1f604.png" alt="smile">
426-
<img class="emoji" src="https://github.githubassets.com/images/icons/emoji/unicode/1f973.png" alt="partying_face">
427-
<img class="emoji" src="https://github.githubassets.com/images/icons/emoji/unicode/1f602.png" alt="joy">
428-
<img class="emoji" src="https://github.githubassets.com/images/icons/emoji/unicode/1f44d.png" alt="+1">
429-
<img class="emoji" src="https://github.githubassets.com/images/icons/emoji/unicode/1f44e.png" alt="-1">
430-
</output>
431-
432-
Platform-native characters when `true`:
433-
434-
<output data-lang="output">
435-
<span class="emoji">😄︎</span>
436-
<span class="emoji">🥳︎</span>
437-
<span class="emoji">😂︎</span>
438-
<span class="emoji">👍︎</span>
439-
<span class="emoji">👎︎</span>
440-
</output>
441-
442-
To render shorthand codes as text, replace `:` characters with the `&colon;` HTML entity.
443-
444-
```markdown
445-
&colon;100&colon;
446-
```
447-
448-
<output data-lang="output">
449-
450-
&colon;100&colon;
451-
452-
</output>
453-
454401
## noEmoji
455402

456403
- type: `Boolean`
457-
- default: `false`
458404

459-
Disabled emoji parsing and render all emoji shorthand as text.
405+
Disabled emoji parse.
460406

461407
```js
462408
window.$docsify = {
463409
noEmoji: true,
464410
};
465411
```
466412

467-
```markdown
468-
:100:
469-
```
470-
471-
<output data-lang="output">
472-
473-
&colon;100&colon;
474-
475-
</output>
476-
477-
To disable emoji parsing of individual shorthand codes, replace `:` characters with the `&colon;` HTML entity.
478-
479-
```markdown
480-
:100:
481-
482-
&colon;100&colon;
483-
```
484-
485-
<output data-lang="output">
486-
487-
:100:
488-
489-
&colon;100&colon;
490-
491-
</output>
413+
?> If this option is `false` but you don't want to emojify some specific colons, [refer to this](https://github.com/docsifyjs/docsify/issues/742#issuecomment-586313143)
492414

493415
## mergeNavbar
494416

@@ -513,7 +435,7 @@ See https://github.com/lukeed/tinydate#patterns
513435
window.$docsify = {
514436
formatUpdated: '{MM}/{DD} {HH}:{mm}',
515437

516-
formatUpdated: function (time) {
438+
formatUpdated: function(time) {
517439
// ...
518440

519441
return time;

0 commit comments

Comments
 (0)