WebReflection / WebReflection/linkedom

`>` inside scripts get escaped.

Open
#199 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
2.1k
Forks
104
PR merge metrics
No merged PRs in 30d

Description

> const { DOMParser } = require("linkedom");
undefined
> const parser = new DOMParser();
undefined
> parser.parseFromString(`<html><body><script>(() => {if (5>4) { console.log('hello') }})()</script></body></html>`).toString()
`<?xml version="1.0" encoding="utf-8"?><html><body><script>(() =&gt; {if (5&gt;4) { console.log('hello') }})()</script></body></html>`

It should be () => { and 5>4

I'm using linkedom@0.14.25

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with DOMParser.parseFromString and the serialized document's toString() output, using the script content shown in the report. Trace the script serialization path and verify that greater-than characters in JavaScript remain unescaped. Done means the output preserves both () => and 5>4 inside the script element.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.