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

Track html tags #46

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft

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.

None yet

1 participant