summaryrefslogtreecommitdiffstats
path: root/lib/parse/parsePage.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/parse/parsePage.js')
-rw-r--r--lib/parse/parsePage.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/parse/parsePage.js b/lib/parse/parsePage.js
index 75bcf61..1d515d6 100644
--- a/lib/parse/parsePage.js
+++ b/lib/parse/parsePage.js
@@ -1,4 +1,6 @@
+var Immutable = require('immutable');
var fm = require('front-matter');
+var direction = require('direction');
/**
Parse a page, read its content and parse the YAMl header
@@ -15,10 +17,11 @@ function parsePage(book, page) {
.then(function(content) {
var parsed = fm(content);
- page = page.set('content', parsed.body);
- page = page.set('attributes', parsed.attributes);
-
- return page;
+ return page.merge({
+ content: parsed.body,
+ attributes: Immutable.fromJS(parsed.attributes),
+ dir: direction(parsed.body)
+ });
});
}