Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HtmlProvider Self closing table tags #1022

Closed
arctiq1 opened this issue Jan 18, 2017 · 1 comment · Fixed by #1061
Closed

HtmlProvider Self closing table tags #1022

arctiq1 opened this issue Jan 18, 2017 · 1 comment · Fixed by #1061

Comments

@arctiq1
Copy link

arctiq1 commented Jan 18, 2017

HtmlProvider doesn't provide tables if they contain self closing tags which are not closed.

According to w3.org HTML 4.01 and HTML 5 TD, TH TR tags needn't be closed. Sadly many apps take advantage of this.

Expected

Parsing self closing tags should behave the same regardless of whether the tags are closed.

Sample error throwing code

// Missing </th>, </tr> and </td>
let [<Literal>] Example = """
<!DOCTYPE html>
<html>
  <body>
    <table>
      <tr>
        <th>Number
        <th>Text
      <tr>
        <td>4
        <td>Hello
    </table>
  </body>
</html>"""

type NotWorking = HtmlProvider<Example>
(NotWorking.GetSample()).Tables.Table1.Rows

Fails with

Error #39 - The field, constructor or member 'Tables' is not defined at line 27 col 25

Sample working alternative

<!DOCTYPE html>
<html>
  <body>
    <table>
      <tr>
        <th>Number</th>
        <th>Text</th>
      </tr>
      <tr>
        <td>4</td>
        <td>Hello</td>
      </tr>
    </table>
  </body>
</html>

The html files are equal, but the second works while the first one does not.

@thinkbeforecoding
Copy link
Contributor

thinkbeforecoding commented Jul 21, 2017

I fixed it with PR #1061.
The PR also fix the <ul><li>a<li>b</ul> case.
It is fixed at the HtmlDocument.Parse level, so it also fix it for the type provider.

ovatsus pushed a commit that referenced this issue Jul 21, 2017
Fix #1022: HtmlProvider Self closing table tags
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants