Invalid HTML produces duplicated elements
Open
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 2.6k
- Forks
- 288
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 8
Description
The following invalid HTML:
<html>
<body>
<div class="tb nb"><a href="https://www.humanw.tu-darmstadt.de/fachbereich/index.de.jspZur Homepage des Fachbereichs.</a><br></div>
<div class="tb" >
</div>
</body>
</html>
produces duplicate elements when parsing with rcdom:
Running `/home/moritz/Documents/html5ever/target/debug/examples/print-rcdom`
#Document
<html>
<head>
<body>
#text: \n
<div class="tb nb">
<a href="https://www.humanw.tu-darmstadt.de/fachbereich/index.de.jspZur Homepage des Fachbereichs.</a><br></div>
<div class=" tb"="">
#text: \n
<a href="https://www.humanw.tu-darmstadt.de/fachbereich/index.de.jspZur Homepage des Fachbereichs.</a><br></div>
<div class=" tb"="">
#text: \n \n \n
Parse errors:
Unexpected token
Bad character
Bad character
Unexpected open element
Unexpected open tag at end of body
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the report with the malformed HTML and the rcdom print-rcdom example mentioned in the issue. Trace how the parser constructs the duplicated elements and malformed class attribute, then verify that the resulting document tree contains only the intended elements while retaining the reported parse errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- html, rust
- Domain
- web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100