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

Aperta
#347 0 commenti 2 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
52/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
markdown, react, typescript
Ambito
frontend

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
TypeScript
Stelle
428
Fork
48
Merge medio
5g 15h
PR unite (30g)
47

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di gravity-ui/markdown-editor

Tutte le issue di gravity-ui/markdown-editor

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.