Expose Gumbo parse errors to Nokogiri document.#46
Conversation
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.
eb59c58 to
e361b49
Compare
|
By the by, Ruby 2.0 and earlier have passed their end of life and 2.1 will only receive security bug fixes. |
|
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!) |
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).
Patches welcome! :-) |
👍 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 😊) |
|
pushed |
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.
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.
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.
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.
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.
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.
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.
Use the internal Gumbo error API to get error parse error information. Expose
this to Ruby by crafting an array of
Nokogiri::XML::SyntaxErrorobjects filledin with a variety of information, including column and line information. These
are stored in the document's
@errorsinstance variable.Note that since the HTML state machine completely specifies what to do on
every parse error, no error is fatal.