Closed hassankhan closed 9 years ago
Rationale for getting rid of only_crawl_id
: Because right now, if you don't pass emojify.run()
any parameter, then it checks only_crawl_id
, and if that's not specified it does the whole document body.
I propose changing it so you can do emojify.run('#content')
and internally use document.querySelector()
to do the magic. If you don't pass a parameter, it processes the rest of the body as usual.
Hi, little update, I think it might also be a good idea to remove ignored_tags
and make both the blacklist
and whitelist
options be an array of valid selectors.
Update 2: The whitelist
and blacklist
options are now objects, rather than arrays:
blacklist: {
"elements": ["body", "code", "script"],
"classes": ["no-emojify"],
"ids": ["special"]
}
Quick update, I've added the blacklist
option and renamed emojify_tag_type
. I'll leave any other improvements till later so v1.0 can be released.
I think we could add more flexible options for targeting elements to emojify. @BenMQ volunteered to do this. Possible ideas for new options:
whitelist
blacklist
Existing options:
emojify_tag_type
tag_type
.only_crawl_id
emojify.run(selector)
insteadimg_dir
ignore_emoticons
ignored_tags
ignore_elements
. An array of elements to never emojify