From 054fea748f5b6aae9043925abf9b66991cd51887 Mon Sep 17 00:00:00 2001
From: John MacFarlane <jgm@berkeley.edu>
Date: Fri, 9 Jan 2015 19:55:29 -0800
Subject: Put limit on AST display as string.

(AST itself has no nesting limits.  BUt this prevents a crash
due to recursion in util.inspect.)

See #272.
---
 js/bin/commonmark | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'js/bin/commonmark')

diff --git a/js/bin/commonmark b/js/bin/commonmark
index 72ad344..4fcb09d 100755
--- a/js/bin/commonmark
+++ b/js/bin/commonmark
@@ -16,7 +16,7 @@ for (var i = 2; i < process.argv.length; i++) {
     var arg = process.argv[i];
     if (arg == '--ast') {
         renderer = { render: function(x) {
-            return util.inspect(x.toAST(), null, Infinity, true) + '\n';
+            return util.inspect(x.toAST(), null, 20, true) + '\n';
         } };
     } else if (arg == '--sourcepos') {
         options.sourcepos = true;
-- 
cgit v1.2.3