Skip to content

Commit

Permalink
Merge pull request #127 from dernasherbrezon/0
Browse files Browse the repository at this point in the history
extract max parsing millis into config
  • Loading branch information
jonbullock committed Aug 20, 2014
2 parents 156e3e2 + beae703 commit 7aaaaaa
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 7aaaaaa

Please sign in to comment.