bump 1.1.4

This commit is contained in:
qingwei.li 2016-12-17 15:56:55 +08:00
parent 9a1db6ed43
commit cc7bdf5df2
2 changed files with 7 additions and 5 deletions

View File

@ -158,7 +158,7 @@ function scrollActiveSidebar () {
function scrollIntoView () {
var id = window.location.hash.match(/#[^#\/]+$/g);
if (!id || !id.length) { return }
var section = document.querySelector(id[0]);
var section = document.querySelector(decodeURIComponent(id[0]));
if (section) { section.scrollIntoView(); }
}
@ -2368,14 +2368,16 @@ var renderer = new marked.Renderer();
* @link https://github.com/chjj/marked#overriding-renderer-methods
*/
renderer.heading = function (text, level) {
var slug = text.toLowerCase().replace(/<(?:.|\n)*?>/gm, '').replace(/[^\w|\u4e00-\u9fa5]+/g, '-');
var slug = text.toLowerCase()
.replace(/<(?:.|\n)*?>/gm, '')
.replace(/[^\w|\u4e00-\u9fa5]+/g, '-');
var route = '';
if (OPTIONS$1.router) {
route = "#/" + (getRoute());
}
toc.push({ level: level, slug: (route + "#" + slug), title: text });
toc.push({ level: level, slug: (route + "#" + (encodeURIComponent(slug))), title: text });
return ("<h" + level + " id=\"" + slug + "\"><a href=\"" + route + "#" + slug + "\" class=\"anchor\"></a>" + text + "</h" + level + ">")
};

4
lib/docsify.min.js vendored

File diff suppressed because one or more lines are too long