diff --git a/README.md b/README.md index 2886605d..a8db4a9d 100644 --- a/README.md +++ b/README.md @@ -18,37 +18,37 @@ Use the following in the `
` tag of your HTML document(s): ## Breaking changes in V2 -_TL;DR_: there's no `variant` anymore, all callbacks receives the transformed `iconId` and in some case the rawText too. +_TL;DR_: there's no `variant` anymore, all callbacks receive the transformed `iconId` and in some cases the rawText too. -There are few potentially breaking changes in `twemoji` version 2: +There are a few potentially breaking changes in `twemoji` version 2: * the `parse` invoked function signature is now `(iconId, options)` instead of `(icon, options, variant)` - * the `attributes` function will receives `(rawText, iconId)` instead of `(icon, variant)` - * the **default** remote protocol is now **https** regardless the current site is _http_ or even _file_ + * the `attributes` function now receives `(rawText, iconId)` instead of `(icon, variant)` + * the **default** remote protocol is now **https** regardless of whether the current site is _http_ or even _file_ * the **default** PNG icon size is **72** pixels and **there are no other PNG assets** for 16 or 32. * in order to access latest assets you need to specify *folder* `2/72x72` or `2/svg`. -Everything else is pretty much the same so if you were using defaults, all you need to do is to add the version `2/` before the `twmoji.js` file you were using. +Everything else is pretty much the same, so if you were using the defaults, all you need to do is to add the version `2/` before the `twemoji.js` file you were using. ## API -Following all methods exposed through the `twemoji` namespace. +Following are all the methods exposed in the `twemoji` namespace. ### twemoji.parse( ... ) V1 -This is the main parsing utility and has 3 overloads per each parsing type. +This is the main parsing utility and has 3 overloads per parsing type. -There are mainly two kind of parsing: [string parsing](https://github.com/twitter/twemoji#string-parsing) and [DOM parsing](https://github.com/twitter/twemoji#dom-parsing). +There are mainly two kinds of parsing: [string parsing](https://github.com/twitter/twemoji#string-parsing) and [DOM parsing](https://github.com/twitter/twemoji#dom-parsing). -Each of them accept a callback to generate each image source or an options object with parsing info. +Each of them accepts a callback to generate an image source or an options object with parsing info. -Here is a walk through all parsing possibilities: +Here is a walkthrough of all parsing possibilities: ##### string parsing (V1) -Given a generic string, it will replace all emoji with an `` tag. +Given a generic string, replaces all emoji with an `` tag. -While this can be used to inject via `innerHTML` emoji image tags, please note that this method does not sanitize the string or prevent malicious code from being executed. As an example, if the text contains a `