Skip to content

Commit b9812a0

Browse files
committed
修复导出pdf第一个链接丢失的bug
1 parent 69e61b0 commit b9812a0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/generate/site/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,18 +151,18 @@ Generator.prototype.convertFile = function(content, _input) {
151151
var that = this;
152152

153153
var _output = _input.replace(".md", ".html");
154-
var introduction = (this.options.introduction !== undefined ? this.options.introduction.path : undefined)
154+
var introduction = (this.options.introduction !== undefined ? this.options.introduction.path : undefined);
155155
if (_output == "README.html" || _input == introduction) {
156156
_output = "index.html";
157157
}
158158
var output = path.join(this.options.output, _output);
159159
var basePath = path.relative(path.dirname(output), this.options.output) || ".";
160-
160+
161161
// Bug fix for issue #493 which would occur when relative-links are 2-level or more deep in win32
162162
if (process.platform === 'win32') {
163163
basePath = basePath.replace(/\\/g, '/');
164164
}
165-
165+
166166
return this.prepareFile(content, _input)
167167
.then(function(page) {
168168
// Index page in search

theme/templates/ebook/summary.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<li>
2020
{% if item.path %}
2121
{% if !externalLink %}
22-
<a href="{{ basePath }}/{{ item.path|mdLink }}">{{ item.title }}</a>
22+
<a href="{{ basePath }}/{{ item.path|mdLink(item.level) }}">{{ item.title }}</a>
2323
{% else %}
2424
<a target="_blank" href="{{ item.path }}">{{ item.title }}</a>
2525
{% endif %}

0 commit comments

Comments
 (0)