mirror of
https://gitee.com/docsifyjs/docsify.git
synced 2024-12-03 04:31:20 +08:00
Support emoji, closed #61
This commit is contained in:
parent
7c4b0b7c74
commit
ccdc3c855a
@ -22,6 +22,7 @@
|
|||||||
- Simple and lightweight (~13kB gzipped)
|
- Simple and lightweight (~13kB gzipped)
|
||||||
- Multiple themes
|
- Multiple themes
|
||||||
- Not build static html files
|
- Not build static html files
|
||||||
|
- Support emoji :laughing:
|
||||||
|
|
||||||
## Quick start
|
## Quick start
|
||||||
Create a `index.html` and using `hash router`.
|
Create a `index.html` and using `hash router`.
|
||||||
|
@ -5,8 +5,9 @@
|
|||||||
> A magical documentation site generator.
|
> A magical documentation site generator.
|
||||||
|
|
||||||
- Simple and lightweight (~13kB gzipped)
|
- Simple and lightweight (~13kB gzipped)
|
||||||
- Multiple themes
|
|
||||||
- Not build static html files
|
- Not build static html files
|
||||||
|
- Support emoji :laughing:
|
||||||
|
- Multiple themes
|
||||||
|
|
||||||
|
|
||||||
[GitHub](https://github.com/QingWei-Li/docsify/)
|
[GitHub](https://github.com/QingWei-Li/docsify/)
|
||||||
|
@ -63,6 +63,10 @@ export function init (options) {
|
|||||||
return `<p>${text}</p>`
|
return `<p>${text}</p>`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
renderer.text = function (text) {
|
||||||
|
return text.replace(/:(\S*?):/ig, '<img class="emoji" src="https://assets-cdn.github.com/images/icons/emoji/$1.png" alt="$1" />')
|
||||||
|
}
|
||||||
|
|
||||||
if (typeof OPTIONS.markdown === 'function') {
|
if (typeof OPTIONS.markdown === 'function') {
|
||||||
markdown.setOptions({ renderer })
|
markdown.setOptions({ renderer })
|
||||||
markdown = OPTIONS.markdown.call(this, markdown)
|
markdown = OPTIONS.markdown.call(this, markdown)
|
||||||
|
@ -7,6 +7,11 @@
|
|||||||
-webkit-font-smoothing: antialiased;
|
-webkit-font-smoothing: antialiased;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.emoji {
|
||||||
|
height: 1.2em;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
.progress {
|
.progress {
|
||||||
background-color: $color-primary;
|
background-color: $color-primary;
|
||||||
height: 2px;
|
height: 2px;
|
||||||
|
Loading…
Reference in New Issue
Block a user