Skip to content

Add :parser_options config option#194

Merged
rgrove merged 1 commit intorgrove:masterfrom
austin-wang:austin-wang/nokogumbo-parsing-options
Sep 7, 2019
Merged

Add :parser_options config option#194
rgrove merged 1 commit intorgrove:masterfrom
austin-wang:austin-wang/nokogumbo-parsing-options

Conversation

@austin-wang
Copy link
Copy Markdown
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.

Copy link
Copy Markdown
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