Skip to content
This repository has been archived by the owner on Aug 26, 2023. It is now read-only.

Expose Gumbo parse errors to Nokogiri document. #46

Merged
merged 1 commit into from
Aug 5, 2016

Conversation

stevecheckoway
Copy link
Collaborator

Use the internal Gumbo error API to get error parse error information. Expose
this to Ruby by crafting an array of Nokogiri::XML::SyntaxError objects filled
in with a variety of information, including column and line information. These
are stored in the document's @errors instance variable.

Note that since the HTML state machine completely specifies what to do on
every parse error, no error is fatal.

Use the internal Gumbo error API to get error parse error information. Expose
this to Ruby by crafting an array of `Nokogiri::XML::SyntaxError` objects filled
in with a variety of information, including column and line information. These
are stored in the document's `@errors` instance variable.

Note that since the HTML state machine completely specifies what to do on
every parse error, no error is fatal.
@stevecheckoway
Copy link
Collaborator Author

By the by, Ruby 2.0 and earlier have passed their end of life and 2.1 will only receive security bug fixes.

@stevecheckoway stevecheckoway mentioned this pull request Aug 4, 2016
@stevecheckoway stevecheckoway reopened this Aug 4, 2016
@rubys rubys merged commit e9f5fe4 into rubys:master Aug 5, 2016
@stevecheckoway stevecheckoway deleted the report-parse-errors branch August 5, 2016 15:48
@jeremy
Copy link
Contributor

jeremy commented Oct 31, 2016

Hey @rubys! Could we get a gem release so we can start depending on this API?

(Would be wonderful to get a toplevel .gemspec, too, so we can bundle from git between gem releases!)

@rubys
Copy link
Owner

rubys commented Oct 31, 2016

Hey @rubys! Could we get a gem release so we can start depending on this API?

Can you give http://intertwingly.net/tmp/nokogumbo-1.4.10.gem a test drive? This gem has a history of problems that only show up on some configurations (most notably, Gentoo, but at times some versions of Mac OS/X).

(Would be wonderful to get a toplevel .gemspec, too, so we can bundle from git between gem releases!)

Patches welcome! :-)

@jeremy
Copy link
Contributor

jeremy commented Nov 1, 2016

Can you give http://intertwingly.net/tmp/nokogumbo-1.4.10.gem a test drive

👍 Package is near-identical to the 1.4.10 gem I built locally. Compiles cleanly and tests pass and Ruby 2.4 and 2.3.

(Background: taking a stab at adding HTML5 support to html-proofer 😊)

@rubys
Copy link
Owner

rubys commented Nov 1, 2016

pushed

jeremy added a commit to jeremy/html-proofer that referenced this pull request Nov 1, 2016
Introduces `--report-missing-doctype`, defaulting to false, to report on
missing `<!DOCTYPE html>` at the beginning of the document.

Depends on Nokogumbo >= 1.4.10 for rubys/nokogumbo#46

Fixes gjtorikian#318.
jeremy added a commit to jeremy/html-proofer that referenced this pull request Nov 2, 2016
Introduces `--report-missing-doctype`, defaulting to false, to report on
missing `<!DOCTYPE html>` at the beginning of the document.

Depends on Nokogumbo >= 1.4.10 for rubys/nokogumbo#46

Fixes gjtorikian#318.
jeremy added a commit to jeremy/html-proofer that referenced this pull request Nov 2, 2016
Introduces `--report-missing-doctype`, defaulting to false, to report on
missing `<!DOCTYPE html>` at the beginning of the document.

Depends on Nokogumbo >= 1.4.10 for rubys/nokogumbo#46

Fixes gjtorikian#318.
jeremy added a commit to jeremy/html-proofer that referenced this pull request Feb 15, 2017
Introduces `--report-missing-doctype`, defaulting to false, to report on
missing `<!DOCTYPE html>` at the beginning of the document.

Depends on Nokogumbo >= 1.4.10 for rubys/nokogumbo#46

Fixes gjtorikian#318.
jeremy added a commit to jeremy/html-proofer that referenced this pull request May 17, 2017
Introduces `--report-missing-doctype`, defaulting to false, to report on
missing `<!DOCTYPE html>` at the beginning of the document.

Depends on Nokogumbo >= 1.4.10 for rubys/nokogumbo#46

Fixes gjtorikian#318.
jeremy added a commit to jeremy/html-proofer that referenced this pull request Sep 4, 2018
Introduces `--report-missing-doctype`, defaulting to false, to report on
missing `<!DOCTYPE html>` at the beginning of the document.

Depends on Nokogumbo >= 1.4.10 for rubys/nokogumbo#46

Fixes gjtorikian#318.
jeremy added a commit to jeremy/html-proofer that referenced this pull request Sep 4, 2018
Introduces `--report-missing-doctype`, defaulting to false, to report on
missing `<!DOCTYPE html>` at the beginning of the document.

Depends on Nokogumbo >= 1.4.10 for rubys/nokogumbo#46

Fixes gjtorikian#318.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants