Added no-emoji

This commit is contained in:
CRIMX 2018-01-05 14:30:59 +08:00
parent fa9253d9ab
commit e52ceb8b18
4 changed files with 9403 additions and 9383 deletions

View File

@ -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

File diff suppressed because it is too large Load Diff

View File

@ -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);

View File

@ -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",