From f31e3c05a5bf4dc50a7f7f9146186a8653aeff3e Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Mon, 6 May 2013 18:13:00 +0100 Subject: Avoid stack overflows with long documents --- lib/document-to-html.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/document-to-html.js b/lib/document-to-html.js index 94c8b6a..5c4db50 100644 --- a/lib/document-to-html.js +++ b/lib/document-to-html.js @@ -42,7 +42,9 @@ function DocumentConverter(options) { function convertParagraph(element, html, messages, callback) { html.satisfyPath(styleForParagraph(element, messages)); - convertElements(element.children, html, messages, callback); + process.nextTick(function() { + convertElements(element.children, html, messages, callback); + }); } function styleForParagraph(element, messages) { -- cgit v1.2.3