Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add :parser_options config option #194

Merged

Conversation

austin-wang
Copy link
Contributor

@austin-wang austin-wang commented Sep 6, 2019

When Sanitize.fragment is called with a string representation of a html document that has nesting that exceeds Nokogumbo::DEFAULT_MAX_TREE_DEPTH (400), the following exception is raised:

ArgumentError: Document tree depth limit exceeded

This pull request adds a new configuration option — :parser_options, that will be supplied to nokogumbo when calling Nokogiri::HTML5.fragment. The supported properties in :parser_options are documented here.

@austin-wang austin-wang force-pushed the austin-wang/nokogumbo-parsing-options branch from 2b355e4 to 6fd16a6 Compare September 6, 2019 17:21
Copy link
Owner

@rgrove rgrove left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! Thanks for the tests and docs. I’ll merge this soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants