html_declaration can be a 2 tuple
derek-zhou opened this issue · 1 comments
derek-zhou commented
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:
floki/src/floki_mochi_html.erl
Line 351 in d3fc8da
<?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?
philss commented
@derek-zhou makes sense to me. Please go ahead if you want to open a PR