Skip to content

Parser: Add max_errors to parse_option_T#1796

Merged
marcoroth merged 4 commits into
mainfrom
max-errors
Jun 12, 2026
Merged

Parser: Add max_errors to parse_option_T#1796
marcoroth merged 4 commits into
mainfrom
max-errors

Conversation

@marcoroth

@marcoroth marcoroth commented Jun 12, 2026

Copy link
Copy Markdown
Owner

This pull request adds a new max_errors argument to parse_option_T and Herb.parse so that the parser stops generating errors after the limit is reached. It defaults to 25 but can be overwritten by passing the max_errors keyword argument to Herb.parse:

Herb.parse(source, max_errors: 50)

Setting max_errors to nil disables the limit.

This prevents pathological inputs (e.g. thousands of unclosed tags) from generating thousands of error objects, which wastes memory and produces output no one will read.

Follow-up to #1795.

@pkg-pr-new

pkg-pr-new Bot commented Jun 12, 2026

Copy link
Copy Markdown
npx https://pkg.pr.new/@herb-tools/formatter@1796
npx https://pkg.pr.new/@herb-tools/language-server@1796
npx https://pkg.pr.new/@herb-tools/linter@1796

commit: 66735c8

@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown

🌿 Interactive Playground and Documentation Preview

A preview deployment has been built for this pull request. Try out the changes live in the interactive playground:


🌱 Grown from commit 66735c8


✅ Preview deployment has been cleaned up.

@marcoroth marcoroth merged commit 3416ce7 into main Jun 12, 2026
38 of 39 checks passed
@marcoroth marcoroth deleted the max-errors branch June 12, 2026 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant