Ox doesn't seem to support HTML5 #89

Closed
YorickPeterse opened this Issue Feb 24, 2014 · 5 comments

Comments

Projects
None yet
2 participants
@YorickPeterse

When parsing HTML5 documents Ox throws syntax errors in various cases where the closing / is not specified. For example, for a link tag they are no longer required in HTML5 (as far as I can tell).

A simple way to reproduce this:

require 'ox'

Ox.parse('<link href="foo.css">')

This results in the following error:

Ox::ParseError: invalid format, document not terminated at line 1, column 23 [parse.c:527]

The expected output was as following:

#<Ox::Element:0x007f14186534d8 @attributes={:href=>"foo.css"}, @value="link">
@ohler55

This comment has been minimized.

Show comment Hide comment
@ohler55

ohler55 Feb 24, 2014

Owner

The only parser that supports html is the sax parser. Were you using the sax parser with the :smart option?

Owner

ohler55 commented Feb 24, 2014

The only parser that supports html is the sax parser. Were you using the sax parser with the :smart option?

@YorickPeterse

This comment has been minimized.

Show comment Hide comment
@YorickPeterse

YorickPeterse Feb 25, 2014

I'm not aware of a :smart option. Would using this (or the sax parser) require writing a custom sax handler?

I'm not aware of a :smart option. Would using this (or the sax parser) require writing a custom sax handler?

@ohler55

This comment has been minimized.

Show comment Hide comment
@ohler55

ohler55 Feb 25, 2014

Owner

It would require writing a sax handler. There are some examples in the test directory.

Owner

ohler55 commented Feb 25, 2014

It would require writing a sax handler. There are some examples in the test directory.

@YorickPeterse

This comment has been minimized.

Show comment Hide comment
@YorickPeterse

YorickPeterse Feb 25, 2014

Ah ok, I'll take a look at it. In that case I'll close this issue. Thanks!

Ah ok, I'll take a look at it. In that case I'll close this issue. Thanks!

@ohler55

This comment has been minimized.

Show comment Hide comment
@ohler55

ohler55 Feb 25, 2014

Owner

If you need any more info let me know. Direct email is fine.

Owner

ohler55 commented Feb 25, 2014

If you need any more info let me know. Direct email is fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment