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

オープン
#347 コメント 0 件 リアクション 2 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
52/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
markdown, react, typescript
領域
frontend

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
TypeScript
スター
428
フォーク
48
平均マージ
5日 15時間
マージ済み PR(30日)
47

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

gravity-ui/markdown-editor のほかの issue

gravity-ui/markdown-editor の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。