mirror of
https://github.com/twitter/twemoji.git
synced 2024-06-15 03:35:16 +00:00
Add custom template function
This commit is contained in:
parent
55443d4b39
commit
1e72ee8631
@ -37,6 +37,9 @@ var twemoji = (function (
|
||||
// default class name, by default 'emoji'
|
||||
className: 'emoji',
|
||||
|
||||
// template function for custom emoji wrapping
|
||||
template: null,
|
||||
|
||||
// basic utilities / helpers to convert code points
|
||||
// to JavaScript surrogates and vice versa
|
||||
convert: {
|
||||
@ -482,6 +485,9 @@ var twemoji = (function (
|
||||
}
|
||||
}
|
||||
ret = ret.concat('>');
|
||||
if (options.template) {
|
||||
ret = options.template.call(null, ret)
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
@ -551,6 +557,7 @@ var twemoji = (function (
|
||||
ext: how.ext || twemoji.ext,
|
||||
size: how.folder || toSizeSquaredAsset(how.size || twemoji.size),
|
||||
className: how.className || twemoji.className,
|
||||
template: how.template || twemoji.template,
|
||||
onerror: how.onerror || twemoji.onerror
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user