Added no-emoji
This commit is contained in:
parent
fa9253d9ab
commit
e52ceb8b18
4 changed files with 9403 additions and 9383 deletions
13
README.md
13
README.md
|
@ -103,6 +103,19 @@ If you do not like the `::`-style keywords, you can always use tags:
|
|||
{% github_emoji sparkles %}
|
||||
```
|
||||
|
||||
Add `no-emoji: true` to front-matter to stop replacing `::`:
|
||||
|
||||
```md
|
||||
---
|
||||
title: Hello World
|
||||
no-emoji: true
|
||||
---
|
||||
|
||||
:tada: as it is.
|
||||
|
||||
{% github_emoji tada %} still works.
|
||||
```
|
||||
|
||||
## Helper
|
||||
|
||||
You can also render a GitHub emoji from a template using the `github_emoji` helper:
|
||||
|
|
18770
emojis.json
18770
emojis.json
File diff suppressed because it is too large
Load diff
1
index.js
1
index.js
|
@ -81,6 +81,7 @@ if (options.enable !== false) {
|
|||
})
|
||||
|
||||
hexo.extend.filter.register('before_post_render', function (data) {
|
||||
if (data['no-emoji']) { return data }
|
||||
data.content = data.content.replace(/:(\w+):/ig, function (match, p1) {
|
||||
if (emojis[p1]) {
|
||||
return getRender(p1);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "hexo-filter-github-emojis",
|
||||
"version": "1.4.3",
|
||||
"version": "1.4.4",
|
||||
"description": "A Hexo plugin that adds emojis support, using Github Emojis API",
|
||||
"main": "index",
|
||||
"repository": "crimx/hexo-filter-github-emojis",
|
||||
|
|
Loading…
Reference in a new issue