GFM protocol autolink starts right after `<`, linking URLs inside non-autolink angle brackets

オープン
#4,155 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

@EnesKartal がすでに取り組んでいます。

2026年11月23日 から。

  • #4156 @princejain756 による — マージされずにクローズ
  • #4279 @EnesKartal による — オープン

評価

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

調査の方向性

The report names marked.parse and says the lexer emits an incorrect link token; it does not identify a source file or test. Start by reading the handling of GFM protocol autolinks and the existing coverage for #4118. Add a regression case for <https://example.com/foo bar> and confirm it renders as plain text.

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

説明

works as intended

Marked version: 18.1.1
Markdown flavor: GitHub Flavored Markdown (default)

Description

Same root cause as #4118, but for the http:// / https:// case, which is still reproducible on 18.1.1. No existing issue that I could find for the protocol variant.

Expectation

<https://example.com/foo bar> is not a CommonMark autolink (link destinations can't contain spaces), and a GFM extended autolink "can only come at the beginning of a line, after whitespace, or any of the delimiting characters *, _, ~, and (" — < is not one of them. GitHub renders it as plain text:

<p>&lt;https://example.com/foo bar&gt;</p>

Result

marked.parse('<https://example.com/foo bar>')
<p>&lt;<a href="https://example.com/foo">https://example.com/foo</a> bar&gt;</p>

The lexer emits a link token with autolink: true for https://example.com/foo even though it directly follows <, so a chunk of a non-autolink gets linked and the link text misrepresents what was written (the bar> part is dropped from the link but the visible text suggests the whole bracket was a URL).

#4118 covered the www. case (<www.example.com>); the protocol case after < still links on 18.1.1.

主要言語
TypeScript
スター
37.3k
フォーク
3.9k
平均マージ
5日 6時間
マージ済み PR(30日)
62

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

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

markedjs/marked のほかの issue

markedjs/marked の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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