Skip to content

Commit

Permalink
Clamp output size to config max if not 0
Browse files Browse the repository at this point in the history
  • Loading branch information
asegal-hs committed Nov 16, 2023
1 parent 38b50a5 commit 4e2e4a1
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,10 @@ public String render(Node root, boolean processExtendRoots) {
* @return rendered result
*/
private String render(Node root, boolean processExtendRoots, long renderLimit) {
OutputList output = new OutputList(renderLimit);
long safeRenderSize = (config.getMaxOutputSize() == 0)
? renderLimit
: Math.min(renderLimit, config.getMaxOutputSize());
OutputList output = new OutputList(safeRenderSize);
for (Node node : root.getChildren()) {
lineNumber = node.getLineNumber();
position = node.getStartPosition();
Expand Down

0 comments on commit 4e2e4a1

Please sign in to comment.