From 3dbd8e21d5cc27fad4e124600851f2b75706c357 Mon Sep 17 00:00:00 2001 From: Andreas Gebhardt Date: Tue, 12 Sep 2017 18:26:51 +0200 Subject: [PATCH] =?UTF-8?q?utilize=20=C2=BBEMOJIone=C2=AB=20for=20website?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit No matter if a emoji is given by the UTF-8 character or the shortname via `:shortname:` EMOJIone's JavaScript method `toImage` [1] > convert native unicode emoji and shortnames directly to images so each looks similar to GitHub's markdown rendered version. [1] https://demos.emojione.com/3.1/jstoimage.html --- index.html | 4 +++- style.css | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 6e9a093..0ebefb4 100644 --- a/index.html +++ b/index.html @@ -14,7 +14,9 @@ + + @@ -40,7 +42,7 @@ .then(res => res.text()) .catch(err => console.error(err)) .then(text => { - md.innerHTML = converter.makeHtml(text); + md.innerHTML = emojione.toImage(converter.makeHtml(text)); }); diff --git a/style.css b/style.css index b30b2d3..188f94f 100644 --- a/style.css +++ b/style.css @@ -55,6 +55,8 @@ sub { bottom: -0.25em; } /** Remove border when inside `a` element in IE 8/9/10. */ img { border: 0; } +img.emojione { height: 20px; } + /** Correct overflow not hidden in IE 9/10/11. */ svg:not(:root) { overflow: hidden; }