diff --git a/src/main/java/org/jbake/parser/MarkdownEngine.java b/src/main/java/org/jbake/parser/MarkdownEngine.java index fad5cd820..c9ec0708f 100644 --- a/src/main/java/org/jbake/parser/MarkdownEngine.java +++ b/src/main/java/org/jbake/parser/MarkdownEngine.java @@ -54,7 +54,10 @@ public void processBody(final ParserContext context) { } } - PegDownProcessor pegdownProcessor = new PegDownProcessor(extensions); + + long maxParsingTime = context.getConfig().getLong("markdown.maxParsingTimeInMillis", PegDownProcessor.DEFAULT_MAX_PARSING_TIME); + + PegDownProcessor pegdownProcessor = new PegDownProcessor(extensions, maxParsingTime); context.setBody(pegdownProcessor.markdownToHtml(context.getBody())); } } diff --git a/src/main/resources/default.properties b/src/main/resources/default.properties index 7b0d08f16..51b6bde35 100644 --- a/src/main/resources/default.properties +++ b/src/main/resources/default.properties @@ -75,6 +75,8 @@ date.format=yyyy-MM-dd # comma delimited default markdown extensions; for available extensions: # http://www.decodified.com/pegdown/api/org/pegdown/Extensions.html markdown.extensions=HARDWRAPS,AUTOLINKS,FENCED_CODE_BLOCKS,DEFINITIONS +# millis to parse single markdown page. See PegDown Parse configuration for details +markdown.maxParsingTimeInMillis=2000 # database store (local, memory) db.store=memory # database path