diff options
author | Aaron O'Mullan <aaron.omullan@friendco.de> | 2014-04-06 14:13:48 -0700 |
---|---|---|
committer | Aaron O'Mullan <aaron.omullan@friendco.de> | 2014-04-06 14:13:48 -0700 |
commit | 9270d7949aaabdcfb31f09bf6c7d1d21ca2d06f0 (patch) | |
tree | 16999f42f46f73933c30628af37d7ed4f7a03712 /lib | |
parent | c98ba22b08759f054748050945a467819e7481a6 (diff) | |
download | gitbook-9270d7949aaabdcfb31f09bf6c7d1d21ca2d06f0.zip gitbook-9270d7949aaabdcfb31f09bf6c7d1d21ca2d06f0.tar.gz gitbook-9270d7949aaabdcfb31f09bf6c7d1d21ca2d06f0.tar.bz2 |
In page parser, lex only if not already lexed
Diffstat (limited to 'lib')
-rw-r--r-- | lib/parse/page.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/parse/page.js b/lib/parse/page.js index 8bef308..559be91 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_'); |