Discussion turns everything after a link into part of the link

オープン 初心者向け
#2,404 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

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

評価

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

調査の方向性

リンクパターンは class-response.component.ts の 51 行目あたりにある urlMatcher です。そのパスグループ (\/.*)? は行末まで続き、スキームは任意なので、"roots.water" のような裸の語も一致します。まずその regex と、それを投稿テキストに適用するコードを読み、次に issue の例で再現してください。リンクが空白で止まり、末尾の句読点が除外され、例文が "example.com/page" だけをリンクしたら完了です。

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

説明

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.

主要言語
TypeScript
スター
4
フォーク
8
平均マージ
3日 8時間
マージ済み PR(30日)
12

環境構築

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

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

WISE-Community/WISE-Client のほかの issue

WISE-Community/WISE-Client の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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