mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-26 12:18:01 +00:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ad425b9772 | |||
| 5238fa352c | |||
| 32183b6650 | |||
| cb3d6a7f01 | |||
| c978f0ab21 | |||
| 33ff60cee7 |
@@ -2,6 +2,14 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
## 3.2.2
|
||||
- Fix catching parsing errors leading to possible missing pages in generated book
|
||||
- Rollback markdown parser to `kramed` until `markup-it` is stable enough
|
||||
|
||||
## 3.2.1
|
||||
- Fix bug on Firefox when navigating to an url containing an hash
|
||||
- Update nunjucks to fix JS error when page contains a lot of templating blocks
|
||||
|
||||
## 3.2.0
|
||||
- Switch markdown parser from `kramed` to `markup-it`
|
||||
- Fix support of `|` in tables
|
||||
|
||||
@@ -9,6 +9,7 @@ var direction = require('direction');
|
||||
* @return {Page}
|
||||
*/
|
||||
function parsePageFromString(page, content) {
|
||||
// Parse page YAML
|
||||
var parsed = fm(content);
|
||||
|
||||
return page.merge({
|
||||
|
||||
@@ -11,15 +11,26 @@ var parsePage = require('./parsePage');
|
||||
|
||||
@param {Book} book
|
||||
@param {String} filePath
|
||||
@return {Page}
|
||||
@return {Page?}
|
||||
*/
|
||||
function parseFilePage(book, filePath) {
|
||||
var fs = book.getContentFS();
|
||||
|
||||
return fs.statFile(filePath)
|
||||
.then(function(file) {
|
||||
var page = Page.createForFile(file);
|
||||
return parsePage(book, page);
|
||||
.then(
|
||||
function(file) {
|
||||
var page = Page.createForFile(file);
|
||||
return parsePage(book, page);
|
||||
},
|
||||
function(err) {
|
||||
// file doesn't exist
|
||||
return null;
|
||||
}
|
||||
)
|
||||
.fail(function(err) {
|
||||
var logger = book.getLogger();
|
||||
logger.error.ln('error while parsing page "' + filePath + '":');
|
||||
throw err;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -48,9 +59,12 @@ function parsePagesList(book) {
|
||||
|
||||
return parseFilePage(book, filepath)
|
||||
.then(function(page) {
|
||||
map = map.set(filepath, page);
|
||||
}, function() {
|
||||
// file doesn't exist
|
||||
if (!page) {
|
||||
return;
|
||||
}
|
||||
|
||||
map = map.set(filepath, page);
|
||||
});
|
||||
})
|
||||
)
|
||||
@@ -65,6 +79,11 @@ function parsePagesList(book) {
|
||||
|
||||
return parseFilePage(book, file.getPath())
|
||||
.then(function(page) {
|
||||
// file doesn't exist
|
||||
if (!page) {
|
||||
return;
|
||||
}
|
||||
|
||||
map = map.set(file.getPath(), page);
|
||||
});
|
||||
})
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "gitbook",
|
||||
"version": "3.2.1",
|
||||
"version": "3.2.2",
|
||||
"homepage": "https://www.gitbook.com",
|
||||
"description": "Library and cmd utility to generate GitBooks",
|
||||
"main": "lib/index.js",
|
||||
@@ -22,7 +22,7 @@
|
||||
"fresh-require": "1.0.3",
|
||||
"front-matter": "^2.1.0",
|
||||
"gitbook-asciidoc": "1.2.2",
|
||||
"gitbook-markdown": "2.0.1",
|
||||
"gitbook-markdown": "1.3.2",
|
||||
"gitbook-plugin-fontsettings": "2.0.0",
|
||||
"gitbook-plugin-highlight": "2.0.2",
|
||||
"gitbook-plugin-livereload": "0.0.1",
|
||||
|
||||
Reference in New Issue
Block a user