summaryrefslogtreecommitdiffstats
path: root/lib/parse/page.js
diff options
context:
space:
mode:
authorAaron O'Mullan <aaron.omullan@friendco.de>2014-04-06 00:19:08 -0700
committerAaron O'Mullan <aaron.omullan@friendco.de>2014-04-06 00:21:55 -0700
commiteeb715d5d6ab94242a9c3dcd7cf834256b6f9219 (patch)
tree1757fdd6d8fa081a6f36472376cb931aa74f32e5 /lib/parse/page.js
parenta8e026a642b6780e01e1c94be9345a01a10018c6 (diff)
downloadgitbook-eeb715d5d6ab94242a9c3dcd7cf834256b6f9219.zip
gitbook-eeb715d5d6ab94242a9c3dcd7cf834256b6f9219.tar.gz
gitbook-eeb715d5d6ab94242a9c3dcd7cf834256b6f9219.tar.bz2
Prevent renderer from mutating sections
Diffstat (limited to 'lib/parse/page.js')
-rw-r--r--lib/parse/page.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/parse/page.js b/lib/parse/page.js
index 75eca9d..b17f593 100644
--- a/lib/parse/page.js
+++ b/lib/parse/page.js
@@ -50,6 +50,9 @@ function sectionType(nodes, idx) {
// Render a section using our custom renderer
function render(section, _options) {
+ // Copy section
+ section = _.toArray(section);
+
// marked's Render expects this, we don't use it yet
section.links = {};