Compare commits

...
3 Commits
Author SHA1 Message Date
qingwei.li abaf5c0849 -> v1.7.4 2017-01-13 23:33:20 +08:00
qingwei.li 336efb30cb bump 1.7.4 2017-01-13 23:33:04 +08:00
qingwei.li fb8bf89d73 Fix bugs caused by the previous version, fixed #56 2017-01-13 23:32:38 +08:00
7 changed files with 20 additions and 6 deletions
+4
View File
@@ -1,3 +1,7 @@
## 1.7.4
### Bug fixes
- Fix bugs caused by the previous version
## 1.7.3
### Bug fixes
- Add `hr` style
+1 -1
View File
@@ -1,6 +1,6 @@
![logo](_media/icon.svg)
# docsify <small>1.7.3</small>
# docsify <small>1.7.4</small>
> A magical documentation site generator.
+6 -1
View File
@@ -2621,9 +2621,12 @@ function renderCover (content) {
if (renderCover.rendered) { return sticky() }
// render cover
var cacheToc = toc.slice();
var html = markdown(content);
var match = html.trim().match('<p><img[^s]+src="(.*?)"[^a]+alt="(.*?)">([^<]*?)</p>$');
toc = cacheToc.slice();
// render background
if (match) {
var coverEl = document.querySelector('section.cover');
@@ -2703,11 +2706,13 @@ var script = document.currentScript || [].slice.call(document.getElementsByTagNa
if (script) {
for (var prop in OPTIONS) {
var val = script.getAttribute('data-' + camel2kebab(prop));
OPTIONS[prop] = isNil(val) ? OPTIONS[prop] : (typeof OPTIONS[prop] === 'string' ? val : true);
OPTIONS[prop] = isNil(val) ? OPTIONS[prop] : (val || true);
}
if (OPTIONS.loadSidebar === true) { OPTIONS.loadSidebar = '_sidebar.md'; }
if (OPTIONS.loadNavbar === true) { OPTIONS.loadNavbar = '_navbar.md'; }
if (OPTIONS.coverpage === true) { OPTIONS.coverpage = '_coverpage.md'; }
if (OPTIONS.repo === true) { OPTIONS.repo = ''; }
if (OPTIONS.name === true) { OPTIONS.name = ''; }
if (OPTIONS.sidebar) { OPTIONS.sidebar = window[OPTIONS.sidebar]; }
}
+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": "1.7.3",
"version": "1.7.4",
"description": "A magical documentation generator.",
"main": "lib/docsify.js",
"files": [
+3 -1
View File
@@ -25,11 +25,13 @@ const script = document.currentScript || [].slice.call(document.getElementsByTag
if (script) {
for (const prop in OPTIONS) {
const val = script.getAttribute('data-' + camel2kebab(prop))
OPTIONS[prop] = isNil(val) ? OPTIONS[prop] : (typeof OPTIONS[prop] === 'string' ? val : true)
OPTIONS[prop] = isNil(val) ? OPTIONS[prop] : (val || true)
}
if (OPTIONS.loadSidebar === true) OPTIONS.loadSidebar = '_sidebar.md'
if (OPTIONS.loadNavbar === true) OPTIONS.loadNavbar = '_navbar.md'
if (OPTIONS.coverpage === true) OPTIONS.coverpage = '_coverpage.md'
if (OPTIONS.repo === true) OPTIONS.repo = ''
if (OPTIONS.name === true) OPTIONS.name = ''
if (OPTIONS.sidebar) OPTIONS.sidebar = window[OPTIONS.sidebar]
}
+3
View File
@@ -160,9 +160,12 @@ export function renderCover (content) {
if (renderCover.rendered) return event.sticky()
// render cover
const cacheToc = toc.slice()
let html = markdown(content)
const match = html.trim().match('<p><img[^s]+src="(.*?)"[^a]+alt="(.*?)">([^<]*?)</p>$')
toc = cacheToc.slice()
// render background
if (match) {
const coverEl = document.querySelector('section.cover')