Discussion turns everything after a link into part of the link

Đang mở Phù hợp với người mới
#2,404 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

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
78/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
frontend

Hướng nghiên cứu

Mẫu liên kết là urlMatcher trong class-response.component.ts khoảng dòng 51; nhóm đường dẫn (\/.*)? của nó chạy đến cuối dòng, và scheme là tùy chọn, nên các từ trần như "roots.water" cũng khớp. Bắt đầu bằng việc đọc regex đó và đoạn mã áp dụng nó vào văn bản bài đăng, sau đó tái hiện với ví dụ trong issue. Hoàn tất khi liên kết dừng ở khoảng trắng, dấu câu ở cuối bị loại trừ và câu ví dụ chỉ liên kết "example.com/page".

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

Mô tả

When a Discussion post or reply contains a web address followed by more text on the same line, the rest of the line becomes part of the link.

How to reproduce

As a student, post "See example.com/page for the data, I think it is wrong." The whole of "example.com/page for the data, I think it is wrong." is one link, and clicking it opens a page that does not exist.

Cause

The path part of urlMatcher in class-response.component.ts (line 51) is (\/.*)?, which matches everything up to the end of the line. Two words joined by a period without a space, such as "roots.water", also become a link, since a scheme is optional and any 2 to 5 lowercase letters count as a top-level domain.

Possible fix

Limit the path to characters that cannot be whitespace, for example (\/[^\s<]*)?, and drop trailing punctuation from the match.

Ngôn ngữ chính
TypeScript
Star
4
Fork
8
Merge trung bình
3 ngày 8 giờ
Pull request đã merge (30 ngày)
12

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

  • Có Dockerfile hoặc tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

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 WISE-Community/WISE-Client

Tất cả issue của WISE-Community/WISE-Client

Issue tương tự

Thêm issue về TypeScript

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.