From 9270d7949aaabdcfb31f09bf6c7d1d21ca2d06f0 Mon Sep 17 00:00:00 2001 From: Aaron O'Mullan Date: Sun, 6 Apr 2014 14:13:48 -0700 Subject: [PATCH] In page parser, lex only if not already lexed --- lib/parse/page.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/parse/page.js b/lib/parse/page.js index 8bef30884..559be9116 100644 --- a/lib/parse/page.js +++ b/lib/parse/page.js @@ -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_');