Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

HTMLAnchorElement throws with malformed URLs

Đang mở
#316 5 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
45/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

Tái hiện lỗi với một URL không hợp lệ như %, sau đó kiểm tra cjs/html/anchor-element.js quanh dòng 19 và thay đổi từ PR #204. Xác minh rằng HTMLAnchorElement không còn hủy bỏ việc tạo HTML đối với các URL không hợp lệ, trong khi cách xử lý hiện có đối với các ký tự đã được mã hóa vẫn được giữ nguyên.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

We use LinkeDOM with Lexical to export HTML from an EditorState on the backend.
The PR #204 introduced decodeURI on get href() and get download() to fix double encoding of already encoded characters but this causes every malformed URL to throw URIError.

For example, a LinkNode in Lexical can be anything, can also have % as URL. When it comes to converting the LinkNode to an HTMLAnchorElement via LinkeDOM, decodeURI throws and the whole HTML generation fails.

It's not a real problem, I can sanitize these URLs myself, but I wanted to report this anyway. Thanks a lot for everything, LinkeDOM is really fast!

Logs
URIError: URI malformed
at decodeURI (<anonymous>)
at set href (/var/app/current/node_modules/linkedom/cjs/html/anchor-element.js:19:55)
at y.updateLinkDOM (file:///var/app/current/node_modules/@lexical/link/LexicalLink.prod.mjs:9:1231)
at y.createDOM (file:///var/app/current/node_modules/@lexical/link/LexicalLink.prod.mjs:9:1125)
at y.exportDOM (file:///var/app/current/node_modules/lexical/Lexical.prod.mjs:9:32114)
at y.exportDOM (file:///var/app/current/node_modules/lexical/Lexical.prod.mjs:9:88429)
at x (file:///var/app/current/node_modules/@lexical/html/LexicalHtml.prod.mjs:9:1403)
at x (file:///var/app/current/node_modules/@lexical/html/LexicalHtml.prod.mjs:9:1543)
at x (file:///var/app/current/node_modules/@lexical/html/LexicalHtml.prod.mjs:9:1543)
at g (file:///var/app/current/node_modules/@lexical/html/LexicalHtml.prod.mjs:9:1128)
Ngôn ngữ chính
HTML
Star
2.1k
Fork
108
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của WebReflection/linkedom

Tất cả issue của WebReflection/linkedom

Issue tương tự

Thêm issue về Web Dev

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.