Compare commits

...

6 Commits

Author SHA1 Message Date
Johan Preynat ad425b9772 Bump version to 3.2.2 2016-10-01 22:35:54 +02:00
Johan Preynat 5238fa352c Rollback to use gitbook-markdown@1.3.2 2016-10-01 22:30:43 +02:00
Johan Preynat 32183b6650 Merge branch 'fix-3.1-version' 2016-10-01 21:49:06 +02:00
Johan Preynat cb3d6a7f01 Correctly handle page parsing errors 2016-10-01 21:47:25 +02:00
Johan Preynat c978f0ab21 Add comment 2016-10-01 21:47:08 +02:00
Samy Pessé 33ff60cee7 Add changes for 3.2.1 2016-09-28 15:56:36 +02:00
4 changed files with 36 additions and 8 deletions
+8
View File
@@ -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
+1
View File
@@ -9,6 +9,7 @@ var direction = require('direction');
* @return {Page}
*/
function parsePageFromString(page, content) {
// Parse page YAML
var parsed = fm(content);
return page.merge({
+25 -6
View File
@@ -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
View File
@@ -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",