Compare commits

...
5 Commits
Author SHA1 Message Date
qingwei.li 168d8475d5 -> v2.0.3 2017-02-07 20:18:28 +08:00
qingwei.li 7ba434e61d bump: 2.0.3 2017-02-07 20:18:25 +08:00
qingwei.li 8cd386ae49 fix: css var polyfill 2017-02-07 20:17:54 +08:00
qingwei.li 8c7e4d7866 fix: rendering emojis 2017-02-07 20:17:12 +08:00
qingwei.li cbaee21ded fix: css var polyfill 2017-02-07 19:54:09 +08:00
8 changed files with 33 additions and 20 deletions
+5
View File
@@ -1,3 +1,8 @@
## 2.0.3
### Bug fixes
- fix: rendering emojis
- fix: css var polyfill
## 2.0.2
### Bug fixes
+1 -1
View File
@@ -1,6 +1,6 @@
![logo](_media/icon.svg)
# docsify <small>2.0.2</small>
# docsify <small>2.0.3</small>
> A magical documentation site generator.
+12 -8
View File
@@ -170,6 +170,7 @@ var merge = Object.assign || function (to) {
function emojify (text) {
return text
.replace(/<(pre|template)[^>]*?>([\s\S]+)<\/(pre|template)>/g, function (match) { return match.replace(/:/g, '__colon__'); })
.replace(/:(\w*?):/ig, '<img class="emoji" src="https://assets-cdn.github.com/images/icons/emoji/$1.png" alt="$1" />')
.replace(/__colon__/g, ':')
}
@@ -2509,14 +2510,17 @@ function cssVars () {
if (block.nodeName === 'STYLE') {
replaceVar(block);
} else if (block.nodeName === 'LINK') {
load(block.getAttribute('href'))
.then(function (res) {
var style = document.createElement('style');
var href = block.getAttribute('href');
style.innerHTML = res;
document.head.appendChild(style);
replaceVar(style);
});
if (!/\.css$/.test(href)) { return }
load(href).then(function (res) {
var style = document.createElement('style');
style.innerHTML = res;
document.head.appendChild(style);
replaceVar(style);
});
}
});
}
@@ -2557,7 +2561,7 @@ function init () {
var hl = prism.highlight(code, prism.languages[lang] || prism.languages.markup);
return ("<pre v-pre data-lang=\"" + lang + "\"><code class=\"lang-" + lang + "\">" + (hl.replace(/:/g, '__colon__')) + "</code></pre>")
return ("<pre v-pre data-lang=\"" + lang + "\"><code class=\"lang-" + lang + "\">" + hl + "</code></pre>")
};
renderer.link = function (href, title, text) {
if (!/:/.test(href)) {
+2 -2
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "docsify",
"version": "2.0.2",
"version": "2.0.3",
"description": "A magical documentation generator.",
"main": "lib/docsify.js",
"files": [
+10 -7
View File
@@ -14,14 +14,17 @@ export function cssVars () {
if (block.nodeName === 'STYLE') {
replaceVar(block)
} else if (block.nodeName === 'LINK') {
load(block.getAttribute('href'))
.then(res => {
const style = document.createElement('style')
const href = block.getAttribute('href')
style.innerHTML = res
document.head.appendChild(style)
replaceVar(style)
})
if (!/\.css$/.test(href)) return
load(href).then(res => {
const style = document.createElement('style')
style.innerHTML = res
document.head.appendChild(style)
replaceVar(style)
})
}
})
}
+1 -1
View File
@@ -39,7 +39,7 @@ export function init () {
renderer.code = function (code, lang = '') {
const hl = Prism.highlight(code, Prism.languages[lang] || Prism.languages.markup)
return `<pre v-pre data-lang="${lang}"><code class="lang-${lang}">${hl.replace(/:/g, '__colon__')}</code></pre>`
return `<pre v-pre data-lang="${lang}"><code class="lang-${lang}">${hl}</code></pre>`
}
renderer.link = function (href, title, text) {
if (!/:/.test(href)) {
+1
View File
@@ -160,6 +160,7 @@ export const merge = Object.assign || function (to) {
export function emojify (text) {
return text
.replace(/<(pre|template)[^>]*?>([\s\S]+)<\/(pre|template)>/g, match => match.replace(/:/g, '__colon__'))
.replace(/:(\w*?):/ig, '<img class="emoji" src="https://assets-cdn.github.com/images/icons/emoji/$1.png" alt="$1" />')
.replace(/__colon__/g, ':')
}