Enhance URL Replacement Functionality to Update Display Text When Pasted Over a Link

Đang mở
#347 0 bình luận 2 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ó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
52/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
markdown, react, typescript
Lĩnh vực
frontend

Hướng nghiên cứu

Start by locating the editor’s link paste and URL-replacement handling in the TypeScript Markdown editor, then reproduce the case where link display text equals its original URL. Check the existing link update logic and nearby tests for link replacement behavior. The change is done when pasting a different URL updates both the link target and matching display text, with a regression test covering this scenario.

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

Mô tả

enhancement
Description

There is an unexpected behavior when trying to replace a link whose display text matches the URL. Currently, if a user pastes a new URL into a link where the display text is identical to the original URL, only the URL is updated while the display text remains unchanged. This causes confusion and seems counterintuitive to the expected behavior.

Steps to Reproduce
  1. Create a link where the display text is equal to the URL (e.g., display text and URL both are "http://example.com").
  2. Highlight the link.
  3. Paste a different URL using Ctrl + V (e.g., "http://newlink.com").
Expected Behavior

The display text should be updated to the new URL (e.g., display text becomes "http://newlink.com").

Actual Behavior

The display text remains as the old URL (e.g., display text stays "http://example.com"), while the URL changes to the new one.

Proposal

Implement a check that updates the display text to match the pasted URL if the original display text was the same as the original URL. This will align user expectations with the behavior of the editor.

Ngôn ngữ chính
TypeScript
Star
428
Fork
48
Merge trung bình
5 ngày 15 giờ
Pull request đã merge (30 ngày)
47

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 gravity-ui/markdown-editor

Tất cả issue của gravity-ui/markdown-editor

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.