Skip to content

Commit

Permalink
extract max parsing millis into config
Browse files Browse the repository at this point in the history
  • Loading branch information
dernasherbrezon committed Aug 14, 2014
1 parent 0eecf0a commit beae703
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/java/org/jbake/parser/MarkdownEngine.java
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
}
}
2 changes: 2 additions & 0 deletions src/main/resources/default.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit beae703

Please sign in to comment.