Closed derek-zhou closed 2 years ago
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:
{:pi, String.t()}
https://github.com/philss/floki/blob/d3fc8dada223eebfb1631164182e465d59836ca7/src/floki_mochi_html.erl#L351
<?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?
<?php
@derek-zhou makes sense to me. Please go ahead if you want to open a PR :+1:
Description
According to the doc, html_declaration is a 3 tuple like:
However, I've encounter a
{:pi, String.t()}
2 tuple. Reading the code a bit, this is actually intentional:https://github.com/philss/floki/blob/d3fc8dada223eebfb1631164182e465d59836ca7/src/floki_mochi_html.erl#L351
<?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?