Auto-generated description drops the text between two colons in the first paragraph

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

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

2026年11月15日 から。

  • #13060 @0z5a による — オープン
  • #13096 @saiv0n による — オープン
  • #13099 @Ganesh1729-ui による — オープン

評価

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

調査の方向性

packages/docusaurus-utils/src/markdownUtils.ts の createExcerpt() から始め、絵文字のクリーンアップパターンを issue で説明されている remark-emoji のショートコードパターンと比較します。ヘルパーの既存のテストを確認し、時刻、文章中のコロン、URL、絵文字のショートコードのケースを追加します。実際のショートコードが削除され、コロンで挟まれたその他のテキストがそのまま残れば完了です。

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

説明

Have you read the Contributing Guidelines on issues?
  • I have read the Contributing Guidelines on issues.
Prerequisites
  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn clear command.
  • I have tried rm -rf node_modules yarn.lock package-lock.json and re-installing packages.
  • I have tried creating a repro with https://new.docusaurus.io.
  • I have read the console error message carefully (if applicable).
Description

When a doc, blog post or page has no description front matter, the description Docusaurus generates from the first paragraph (<meta name="description">, og:description, DocCard text on category index pages, blog feed items) loses everything between the first and the last colon of that line.

The emoji-shortcode cleanup in createExcerpt() (packages/docusaurus-utils/src/markdownUtils.ts) uses /\s?:(?:::|[^:\n])+:/g, which matches any text between two colons, spaces included, not just shortcodes like :wink:.

The Docusaurus website shows it today: https://docusaurus.io/docs/3.8.1/sidebar/items has no description front matter, and its first paragraph is "We have introduced three types of item types in the example in the previous section: doc, category, and link, whose usages are fairly intuitive. We will formally introduce their APIs. There's also a fourth type: autogenerated, which we will explain in detail later." The page ships <meta name="description" content="We have introduced three types of item types in the example in the previous section autogenerated, which we will explain in detail later."/>.

Reproducible demo

https://docusaurus.io/docs/3.8.1/sidebar/items (view the page source, description / og:description meta tags)

Steps to reproduce
  1. Open https://docusaurus.io/docs/3.8.1/sidebar/items and look at its <meta name="description">; compare it with the first paragraph of website/versioned_docs/version-3.8.1/guides/docs/sidebar/items.mdx.
  2. Or call the helper directly on main: createExcerpt('Meeting runs 10:30 to 11:45 daily.') from @docusaurus/utils returns 'Meeting runs 1045 daily.'. Docs, blog posts and pages use this excerpt as description when the front matter has none.
Expected behavior

The description keeps the sentence as written (Meeting runs 10:30 to 11:45 daily.), the same way the page body renders it. Only real emoji shortcodes such as :wink: or :+1: should be removed, matching what remark-emoji (markdown.emoji, on by default) converts: /:\+1:|:-1:|:[\w-]+:/g.

Actual behavior
  • Meeting runs 10:30 to 11:45 daily. gives Meeting runs 1045 daily.
  • Note: install first. Tip: run the build. gives Note run the build.
  • Download it from https://nodejs.org. Then run: npm ci gives Download it from https npm ci
Your environment
  • Docusaurus version used: main
  • Environment name and version: Node.js, any
  • Operating system and version: any
Self-service
  • I'd be willing to fix this bug myself.

This issue was drafted with Claude Code (claude-opus-5-5); the results above are from the runs described.

主要言語
TypeScript
スター
66.6k
フォーク
10.1k
PR マージ指標
30日以内にマージされた PR はありません

環境構築

Codespaces で開く

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

はじめの一歩

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

facebook/docusaurus のほかの issue

facebook/docusaurus の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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