philss/floki

html_declaration can be a 2 tuple

derek-zhou opened this issue · 1 comments

Description

According to the doc, html_declaration is a 3 tuple like:

@type html_declaration() :: {:pi, String.t(), [html_attribute()]}

However, I've encounter a {:pi, String.t()} 2 tuple. Reading the code a bit, this is actually intentional:

<<_:O/binary, "<?php", _/binary>> ->

<?php is broken html but unfortunately exists in the wild; most people would be happy if they do not exist. May I suggest to change this 2 tuple into a 3 tuple with a empty html_attribute list, so it is consistent with the documentation?

@derek-zhou makes sense to me. Please go ahead if you want to open a PR 👍