In page parser, lex only if not already lexed

This commit is contained in:
Aaron O'Mullan
2014-04-06 14:13:48 -07:00
parent c98ba22b08
commit 9270d7949a
+2 -1
View File
@@ -39,7 +39,8 @@ function render(section, _options) {
function parsePage(src, options) {
options = options || {};
return lex(src)
// Lex if not already lexed
return (_.isArray(src) ? src : lex(src))
.map(function(section) {
// Generate a uniqueId to identify this section in our code
var id = _.uniqueId('gitbook_');