From 17546d2d165b272735458937ccb97c1f1befc7b3 Mon Sep 17 00:00:00 2001 From: Spax Date: Tue, 30 Jan 2024 23:27:09 -0700 Subject: [PATCH 1/8] markdown fixes --- CONTRIBUTING.md | 16 ++++----- README.md | 87 +++++++++++++++++++++++++------------------------ 2 files changed, 52 insertions(+), 51 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6c6e5b36f..1d185e614 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -13,7 +13,7 @@ Guidelines for bug reports: reported. 2. **Check if the issue has been fixed** — try to reproduce it using the - latest `master` or development branch in the repository. + latest `main` or development branch in the repository. 3. **Isolate the problem** — ideally create a reduced test case and a live example. @@ -25,7 +25,7 @@ Guidelines for bug reports: ## Feature requests & contribution enquiries Feature requests are welcome. But take a moment to find out whether your idea -fits with the scope and aims of the project. It's up to *you* to make a strong +fits with the scope and aims of the project. It's up to _you_ to make a strong case for the inclusion of your feature. Please provide as much detail and context as possible. @@ -43,7 +43,7 @@ If you'd like to test and/or contribute please follow these instructions. ```bash # clone your fork -git clone -b master https://github.com/$YOUR_USERNAME/twemoji.git/ +git clone https://github.com/$YOUR_USERNAME/twemoji.git cd twemoji # install dependencies @@ -65,15 +65,15 @@ project: 1. Create a new topic branch to contain your feature, change, or fix: -> If you'd like to test and/or propose some changes to the latest library version please change the `./scripts/build.js` file at its end so that everything will be generated properly once launched. +> If you'd like to test and/or propose some changes to the latest library version please change the [./scripts/build.js](./scripts/build.js) file at its end so that everything will be generated properly once launched. 1. Commit your changes in logical chunks. Provide clear and explanatory commit messages. Use git's [interactive rebase](https://help.github.com/en/articles/about-git-rebase) feature to tidy up your commits before making them public. -2. Run `yarn prepublish`. This will do several things: +2. Run `yarn prepublishOnly`. This will do several things: - 1. Ask for the version number (See: [SemVer](https://semver.org/)) + 1. Ask for the version number (See: [SemVer](https://semver.org)) 2. Build the project and put the built assets in `dist/` 3. Run the tests 4. Move the contents of the `dist/` directory to the `gh-pages` branch @@ -88,8 +88,8 @@ commits. 1. Push your topic branch up to your fork: `git push origin my-feature-branch` -2. [Open a Pull Request](http://help.github.com/send-pull-requests/) with a - clear title and description. One for your changes in `master` and another one for +2. [Open a Pull Request](http://help.github.com/send-pull-requests) with a + clear title and description. One for your changes in `main` and another one for your changes in `gh-pages`. ## License diff --git a/README.md b/README.md index db4c420b1..f7a5d736b 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# Twitter Emoji (Twemoji) [![Build Status](https://travis-ci.org/twitter/twemoji.svg?branch=gh-pages)](https://travis-ci.org/twitter/twemoji) +# Twitter Emoji (Twemoji) [![Build Status](https://travis-ci.org/jdecked/twemoji.svg?branch=gh-pages)](https://travis-ci.org/jdecked/twemoji) A simple library that provides standard Unicode [emoji](http://en.wikipedia.org/wiki/Emoji) support across all platforms. -**Twemoji v15.0** adheres to the [Unicode 15.0 spec](https://unicode.org/versions/Unicode15.0.0/) and supports the [Emoji 15.0 spec](https://www.unicode.org/reports/tr51/tr51-23.html). _We do not support custom emoji._ +**Twemoji v15.0** adheres to the [Unicode 15.0 spec](https://unicode.org/versions/Unicode15.0.0) and supports the [Emoji 15.0 spec](https://www.unicode.org/reports/tr51/tr51-23.html). _We do not support custom emoji._ The Twemoji library offers support for all Unicode-defined emoji which are recommended for general interchange (RGI). @@ -10,7 +10,7 @@ The Twemoji library offers support for all Unicode-defined emoji which are recom ### CDN Support -Default CDN support is provided via [jsDelivr](https://www.jsdelivr.com/). +Default CDN support is provided via [jsDelivr](https://www.jsdelivr.com). Use the following in the `` tag of your HTML document(s): @@ -21,8 +21,9 @@ Use the following in the `` tag of your HTML document(s): This guarantees that you will always use the latest version of the library. If, instead, you'd like to include the latest version explicitly, you can add the following tag: + ```html - + ``` ### Download @@ -39,22 +40,22 @@ This is the main parsing utility and has 3 overloads per parsing type. Although there are two kinds of parsing supported by this utility, we recommend you use [DOM parsing](https://github.com/jdecked/twemoji#dom-parsing), explained below. Each type of parsing accepts a callback to generate an image source or an options object with parsing info. -The second kind of parsing is string parsing, explained in the legacy documentation [here](https://github.com/jdecked/twemoji/blob/master/LEGACY.md#string-parsing). This is unrecommended because this method does not sanitize the string or otherwise prevent malicious code from being executed; such sanitization is out of scope. +The second kind of parsing is string parsing, explained in the legacy documentation [here](https://github.com/jdecked/twemoji/blob/main/LEGACY.md#string-parsing). This is unrecommended because this method does not sanitize the string or otherwise prevent malicious code from being executed; such sanitization is out of scope. #### DOM parsing If the first argument to `twemoji.parse` is an `HTMLElement`, generated image tags will replace emoji that are **inside `#text` nodes only** without compromising surrounding nodes or listeners, and completely avoiding the usage of `innerHTML`. -If security is a major concern, this parsing can be considered the safest option but with a slight performance penalty due to DOM operations that are inevitably *costly*. +If security is a major concern, this parsing can be considered the safest option but with a slight performance penalty due to DOM operations that are inevitably _costly_. ```js -var div = document.createElement('div'); +let div = document.createElement('div'); div.textContent = 'I \u2764\uFE0F emoji!'; document.body.appendChild(div); twemoji.parse(document.body); -var img = div.querySelector('img'); +let img = div.querySelector('img'); // note the div is preserved img.parentNode === div; // true @@ -73,16 +74,16 @@ All other overloads described for `string` are available in exactly the same way Here's the list of properties accepted by the optional object that can be passed to the `parse` function. ```js - { - callback: Function, // default the common replacer - attributes: Function, // default returns {} - base: string, // default jsDelivr - ext: string, // default ".png" - className: string, // default "emoji" - size: string|number, // default "72x72" - folder: string // in case it's specified - // it replaces .size info, if any - } +{ + callback: Function, // default the common replacer + attributes: Function, // default returns {} + base: string, // default jsDelivr + ext: string, // default ".png" + className: string, // default "emoji" + size: string|number, // default "72x72" + folder: string // in case it's specified + // it replaces .size info, if any +} ``` #### callback @@ -146,7 +147,7 @@ For a given HEX codepoint, returns UTF-16 surrogate pairs. ```js twemoji.convert.fromCodePoint('1f1e8'); - // "\ud83c\udde8" +// "\ud83c\udde8" ``` ### twemoji.convert.toCodePoint() @@ -154,11 +155,11 @@ twemoji.convert.fromCodePoint('1f1e8'); For given UTF-16 surrogate pairs, returns the equivalent HEX codepoint. ```js - twemoji.convert.toCodePoint('\ud83c\udde8\ud83c\uddf3'); - // "1f1e8-1f1f3" +twemoji.convert.toCodePoint('\ud83c\udde8\ud83c\uddf3'); +// "1f1e8-1f1f3" - twemoji.convert.toCodePoint('\ud83c\udde8\ud83c\uddf3', '~'); - // "1f1e8~1f1f3" +twemoji.convert.toCodePoint('\ud83c\udde8\ud83c\uddf3', '~'); +// "1f1e8~1f1f3" ``` ## Tips @@ -169,10 +170,10 @@ If you'd like to size the emoji according to the surrounding text, you can add t ```css img.emoji { - height: 1em; - width: 1em; - margin: 0 .05em 0 .1em; - vertical-align: -0.1em; + height: 1em; + width: 1em; + margin: 0 .05em 0 .1em; + vertical-align: -0.1em; } ``` @@ -188,29 +189,29 @@ To properly support emoji, the document character set must be set to UTF-8. This ### Exclude Characters (V1) -To exclude certain characters from being replaced by twemoji.js, call twemoji.parse() with a callback, returning false for the specific unicode icon. For example: +To exclude certain characters from being replaced by twemoji.js, call `twemoji.parse()` with a callback, returning false for the specific unicode icon. For example: ```js twemoji.parse(document.body, { - callback: function(icon, options, variant) { - switch ( icon ) { - case 'a9': // © copyright - case 'ae': // ® registered trademark - case '2122': // ™ trademark - return false; - } - return ''.concat(options.base, options.size, '/', icon, options.ext); + callback: function(icon, options, variant) { + switch (icon) { + case 'a9': // © copyright + case 'ae': // ® registered trademark + case '2122': // ™ trademark + return false; } + return ''.concat(options.base, options.size, '/', icon, options.ext); + } }); ``` ## Legacy API (V1) -If you're still using our V1 API, you can read our legacy documentation [here](https://github.com/jdecked/twemoji/tree/master/LEGACY.md). +If you're still using our V1 API, you can read our legacy documentation [here](https://github.com/jdecked/twemoji/tree/main/LEGACY.md). ## Contributing -The contributing documentation can be found [here](https://github.com/jdecked/twemoji/tree/master/CONTRIBUTING.md). +The contributing documentation can be found [here](https://github.com/jdecked/twemoji/tree/main/CONTRIBUTING.md). ## Attribution Requirements @@ -221,19 +222,19 @@ However, we consider the guide a bit onerous and as a project, will accept a men ## Community Projects * [Twemoji Cheatsheet](https://twemoji-cheatsheet.vercel.app) by [@ShahriarKh](https://github.com/ShahriarKh): An easy-to-use cheatsheet for exploring, copying and downloading emojis! -* [Twemoji Amazing](https://github.com/SebastianAigner/twemoji-amazing) by [@SebastianAigner](https://github.com/SebastianAigner): Use Twemoji using CSS classes (like [Font Awesome](http://fortawesome.github.io/Font-Awesome/)). +* [Twemoji Amazing](https://github.com/SebastianAigner/twemoji-amazing) by [@SebastianAigner](https://github.com/SebastianAigner): Use Twemoji using CSS classes (like [Font Awesome](http://fortawesome.github.io/Font-Awesome)). * [Twemoji Ruby](https://github.com/jollygoodcode/twemoji) by [@JollyGoodCode](https://twitter.com/jollygoodcode): Use Twemoji in Ruby. * [Twemoji Utils](https://github.com/gustavwilliam/twemoji-utils) by [@gustavwilliam](https://github.com/gustavwilliam): Utilities for finding and downloading Twemoji source files. * [Twemoji for Pencil](https://github.com/nathanielw/Twemoji-for-Pencil) by [@Nathanielnw](https://twitter.com/nathanielnw): Use Twemoji in Pencil. -* [FrwTwemoji - Twemoji in dotnet](http://github.frenchw.net/FrwTwemoji/) by [@FrenchW](https://twitter.com/frenchw): Use Twemoji in any dotnet project (C#, asp.net ...). -* [Emojiawesome - Twemoji for Yellow](https://github.com/datenstrom/yellow-extensions/tree/master/source/emojiawesome) by [@datenstrom](https://github.com/datenstrom/): Use Twemoji on your website. +* [FrwTwemoji - Twemoji in dotnet](http://github.frenchw.net/FrwTwemoji) by [@FrenchW](https://twitter.com/frenchw): Use Twemoji in any dotnet project (C#, asp.net ...). +* [Emojiawesome - Twemoji for Yellow](https://github.com/datenstrom/yellow-extensions/tree/main/source/emojiawesome) by [@datenstrom](https://github.com/datenstrom): Use Twemoji on your website. * [EmojiPanel for Twitter](https://github.com/danbovey/EmojiPanel) by [@danielbovey](https://twitter.com/danielbovey/status/749580050274582528): Insert Twemoji into your tweets on twitter.com. * [Twitter Color Emoji font](https://github.com/eosrei/twemoji-color-font) by [@bderickson](https://twitter.com/bderickson): Use Twemoji as your system default font on Linux & OS X. * [Emojica](https://github.com/xoudini/emojica) by [@xoudini](https://twitter.com/xoudini): An iOS framework allowing you to replace all standard emoji in strings with Twemoji. * [gwt-twemoji](https://github.com/phpmonkeys-de/gwt-twemoji) by [@nbartels](https://github.com/nbartels): Use Twemoji in GWT * [JavaFXEmojiTextFlow](https://github.com/pavlobu/emoji-text-flow-javafx) by [@pavlobu](https://github.com/pavlobu): A JavaFX library allowing you to replace all standard emoji in extended EmojiTextFlow with Twemoji. * [Vue Twemoji Picker](https://github.com/kevinfaguiar/vue-twemoji-picker) by [@kevinfaguiar](https://github.com/kevinfaguiar): A fast plug-n-play Twemoji Picker (+textarea for Twemoji rendering) for Vue. -* [Unmaintained] [Twemoji Awesome](http://ellekasai.github.io/twemoji-awesome/) by [@ellekasai](https://twitter.com/ellekasai/): Use Twemoji using CSS classes (like [Font Awesome](http://fortawesome.github.io/Font-Awesome/)). +* [Unmaintained] [Twemoji Awesome](http://ellekasai.github.io/twemoji-awesome) by [@ellekasai](https://twitter.com/ellekasai): Use Twemoji using CSS classes (like [Font Awesome](http://fortawesome.github.io/Font-Awesome)). * [EmojiOnRoku](https://github.com/KasperGam/EmojiOnRoku) by [@KasperGam](https://github.com/KasperGam): Use Twemoji on Roku! * [LaTeX Twemoji](https://gitlab.com/rossel.jost/latex-twemojis) by [@rossel.jost](https://gitlab.com/rossel.jost): Use Twemoji in LaTeX. * [PHP Twemoji](https://github.com/Astrotomic/php-twemoji) by [@Astrotomic](https://github.com/Astrotomic): Use twemoji within your PHP website project's by replacing standard Emoji with twemoji urls. @@ -262,4 +263,4 @@ Copyright 2019 Twitter, Inc and other contributors Code licensed under the MIT License: -Graphics licensed under CC-BY 4.0: +Graphics licensed under CC-BY 4.0: From 5fe87d7445731defaff013c9643ba67b0245bf5c Mon Sep 17 00:00:00 2001 From: Spax Date: Tue, 30 Jan 2024 23:27:31 -0700 Subject: [PATCH 2/8] delete the unused and outdated FOLDERS.md file --- FOLDERS.md | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 FOLDERS.md diff --git a/FOLDERS.md b/FOLDERS.md deleted file mode 100644 index 4afdec8a1..000000000 --- a/FOLDERS.md +++ /dev/null @@ -1,21 +0,0 @@ - -| Top level | Second | Files | Description | Version | -|-----------|--------|-------|-------------|---------| -| . | | *.md, *.json, .* | meta data | 1.0, 2.2 | -| . | | twemoji*.js, *.js, [*.html](https://twitter.github.io/twemoji/) | framework, preview | 1.0 | -| 1/ | | twemoji*.js | | 1.0 | -| 1/ | templates/ | preview*.html | source for ../test/, used by ../utils/preview | 1.0 | -| 1/ | test/ | preview*.html | [static image preview HTML files](https://twitter.github.io/twemoji/1/test/preview.html) | 1.0 | -| 1/ | utils/ | *. | shell scripts | 1.0 | -| 2/ | | twemoji*.js | framework | 2.2 | -| 2/ | templates/ | preview*.html | source for ../test/, used by ../utils/preview | 2 .2| -| 2/ | test/ | preview*.html, index.html, test.js | [static image preview HTML files](https://twitter.github.io/twemoji/2/test/preview.html), ... | 2.2 | -| 2/ | utils/ | *. | shell scripts | 2.2 | -| 2/ | 72x72/ | {codepoint}.png | large PNGs | 2.2 | -| 2/ | assets/ | {codepoint}.ai | Adobe Illustrator sources | 2.2 | -| 2/ | svg/ | {codepoint}.svg | SVGs | 2.2 | -| 16x16/ | | {codepoint}.png | small PNGs | 1.0 | -| 36x36/ | | {codepoint}.png | medium PNGs | 1.0 | -| 72x72/ | | {codepoint}.png | large PNGs | 1.0 | -| assets/ | | {codepoint}.ai | Adobe Illustrator sources | 1.0 | -| svg/ | | {codepoint}.svg | SVGs | 1.0 | From b7bcd78f9c2600e8efa70248cd5a593b976e295a Mon Sep 17 00:00:00 2001 From: Spax Date: Tue, 30 Jan 2024 23:28:05 -0700 Subject: [PATCH 3/8] update all the main html files --- index.html | 34 ++++++++++++++++++---------------- src/test/base.html | 20 ++++++++++---------- src/test/preview-svg.html | 2 +- src/test/preview.html | 2 +- 4 files changed, 30 insertions(+), 28 deletions(-) diff --git a/index.html b/index.html index b6a058fc1..7e4df479c 100644 --- a/index.html +++ b/index.html @@ -15,39 +15,41 @@ font-size: 36px; color: #600; } - h1 .emoji { - width: 36px; - height: 36px; - margin-bottom: -8px; - } a, a:visited { color: #777; } - a .emoji { - border: 0; - width: 16px; - height: 16px; - margin-bottom: -2px; + img.emoji { + height: 1em; + width: 1em; + margin: 0 .05em 0 .1em; + vertical-align: -0.1em; }

Twem❤ji

-

Sharing Twitter emoji everywhere

+

Sharing Twitter emoji everywhere

Version 15.0 Is Out!

Grab me on GitHub ↗

- - + +

- - + +

Code licensed under MIT. Graphics licensed under CC-BY

diff --git a/src/test/base.html b/src/test/base.html index 454bf9fb1..645dcf3bb 100644 --- a/src/test/base.html +++ b/src/test/base.html @@ -6,22 +6,22 @@ basic test - +