Skip to content

Conversation

@jelmervdl
Copy link
Member

Implementation of the html tag per paragraph part discussed in #40.

Split off from #35 so that can be merged while figuring out how to do this can continue..

@jelmervdl jelmervdl mentioned this pull request Nov 9, 2023
3 tasks
@jelmervdl
Copy link
Member Author

I've started adding tests for html parsing, and it is showing the limits of our html parser.

We don't keep a stack, so for example, this causes a problem:

<div>
  <p>Text</p>
  not block text
  <p>Paragraph</p>
  final line
</div>

Tags are assigned once the opening or closing element of a block element is scanned.

Here, not block text is also assigned a <p> tag because there is no </div> there, and the scanner's tag_name is not reset to the enclosing element (div) once </p> is scanned. It is still set to p after scanning </p>. The final line bit will be correctly assigned </div> because tag_name is once again set to div since it just scanned a closing element.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant