From ccdc3c855a7b8e3c34b899772c1a46e11e69b3bc Mon Sep 17 00:00:00 2001 From: "qingwei.li" Date: Wed, 25 Jan 2017 15:07:36 +0800 Subject: [PATCH] Support emoji, closed #61 --- README.md | 1 + docs/_coverpage.md | 3 ++- src/render.js | 4 ++++ src/themes/basic/_layout.css | 5 +++++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b45afbd3..0e1938cb 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ - Simple and lightweight (~13kB gzipped) - Multiple themes - Not build static html files +- Support emoji :laughing: ## Quick start Create a `index.html` and using `hash router`. diff --git a/docs/_coverpage.md b/docs/_coverpage.md index 48477265..32859b5b 100644 --- a/docs/_coverpage.md +++ b/docs/_coverpage.md @@ -5,8 +5,9 @@ > A magical documentation site generator. - Simple and lightweight (~13kB gzipped) -- Multiple themes - Not build static html files +- Support emoji :laughing: +- Multiple themes [GitHub](https://github.com/QingWei-Li/docsify/) diff --git a/src/render.js b/src/render.js index fc0ceb47..51dcc09d 100644 --- a/src/render.js +++ b/src/render.js @@ -63,6 +63,10 @@ export function init (options) { return `

${text}

` } + renderer.text = function (text) { + return text.replace(/:(\S*?):/ig, '$1') + } + if (typeof OPTIONS.markdown === 'function') { markdown.setOptions({ renderer }) markdown = OPTIONS.markdown.call(this, markdown) diff --git a/src/themes/basic/_layout.css b/src/themes/basic/_layout.css index cde49f67..5acaf5e9 100644 --- a/src/themes/basic/_layout.css +++ b/src/themes/basic/_layout.css @@ -7,6 +7,11 @@ -webkit-font-smoothing: antialiased; } +.emoji { + height: 1.2em; + vertical-align: middle; +} + .progress { background-color: $color-primary; height: 2px;