Text escaping of $& becomes ><
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript
- Lĩnh vực
- web-dev
Hướng nghiên cứu
Bắt đầu với các đường dẫn parseHTML, script element, textContent và document.toString() được показ示 trong reproduction. So sánh kết quả đã serialize với đầu ra của trình duyệt cho giá trị var $=1;$\u0026\u0026true. Hoàn thành khi việc serialize script giữ nguyên $6�? dưới dạng văn bản để JavaScript SSR inline vẫn hợp lệ.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Hello!
I think I have found a slight issue with how text is escaped. using this code:
import { parseHTML } from "https://esm.sh/linkedom"
const { document } = parseHTML('')
document.appendChild(document.createElement('script'))
document.querySelector("script").textContent = 'var $=1;$&&true'
console.log(document.toString())
logs <script>var $=1;><&true</script> as output. $& has been replaced by ><.
If I run similar code in a browser I get <script>var $=1;$&&true</script>. The code I ran in the browser is
var doc = document.createDocumentFragment()
doc.appendChild(document.createElement('script'))
doc.querySelector("script").textContent = 'var $=1;$&&true';
console.log(doc.querySelector("script").outerHTML)
This is a bit problematic for me since it means that inlineing my JS after SSR produces invalid code which will not run.
I have tested it in deno (v1.24.3), node (v18.2.0) and bun.sh (v0.1.11) so I don't think it's anything platform specific.
Thanks!
- Ngôn ngữ chính
- HTML
- Star
- 2.1k
- Fork
- 104
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của WebReflection/linkedom
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
WebReflection/linkedom#329 · 5 bình luận ·
-
`el.style.property = ''` and `e.style.setProperty('property', '')` should delete the property Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 52/100
WebReflection/linkedom#327 · 1 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
WebReflection/linkedom#326 · 5 bình luận ·
-
Build Apps For AI Agent. Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
WebReflection/linkedom#321 · 1 bình luận ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
WebReflection/linkedom#318 · 5 bình luận ·
Tất cả issue của WebReflection/linkedom
Issue tương tự
-
area/profiles comp/cli comp/dashboard P2 sweeper:risk-session-state type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
NousResearch/hermes-agent#122365 ·
-
docs web/
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
chore
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
select の共通部品を作り、旅プランのエリア欄を置き換える Đang mởdesign phase:2 size:S
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
poker-hack-stage/anaba#75 ·
-
bug confirmed issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
open-webui/open-webui#31373 · 1 bình luận ·