Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[VS Code] Single-line display math ($$...$$) renders with literal dollar signs in "Quarto: Equation" assist preview

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

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

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

評価

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

調査の方向性

issueでは、apps/vscode / out/lsp/lsp.js にある Quarto Language Server のフォールバック数式抽出が指摘されています。正規表現のマッチ順を読み、Equation assist のプレビューに抽出されたテキストがどのように渡されるかを確認してください。issue の1行のディスプレイ数式の例を試してください。ディスプレイ数式がドル記号なしでプレビューされ、インライン数式も引き続き正しくレンダリングされれば完了です。

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

説明

bug vscode
Bug description

When the cursor is positioned on a single-line display math equation (e.g., $$ y = mx + q $$), the Quarto: Equation assist panel renders the equation with spurious literal dollar signs at both ends:
$y = mx + q$

In contrast, standard inline math on a single dollar delimiter (e.g., $y = mx + q$) renders cleanly without any dollar signs.

Steps to reproduce
  1. Open a .qmd document in VS Code with the Quarto extension installed and enabled.
  2. Type a display math equation on a single line, for example:
    $$ y + 0.900 = 9.638 x^{-1.394} $$
    
  3. Place the cursor anywhere within or on that line.
  4. Inspect the Quarto: Equation assist panel in the sidebar/panel.
Actual behavior

The equation preview in the Quarto: Equation panel renders with visible dollar symbols:
$y + 0.900 = 9.638 x^{-1.394}$

Expected behavior

The equation preview should render cleanly without leading or trailing dollar signs:
y + 0.900 = 9.638 x^{-1.394}

Your environment

vscode
ubuntu

Root Cause Analysis

In the Quarto Language Server (apps/vscode / out/lsp/lsp.js), the fallback math extraction function for the current line evaluates the inline math regex before the display math regex:

return findMatch(pos, line, inlineRegex) || findMatch(pos, line, displayRegex);

Where:

  • inlineRegex: /\$([^ ].*?[^ ]?)\$/g
  • displayRegex: /\$\$([^\n]+?)\$\$/

When scanning a line containing single-line display math like $$ y + 0.900 = 9.638 x^{-1.394} $$:

  1. The inline regex (inlineRegex) matches first.
  2. The 1st $ satisfies the opening delimiter \$.
  3. The 2nd $ (not being whitespace [^ ]) is treated as the start of the formula text group ([^ ].*?[^ ]?).
  4. The 3rd $ satisfies the closing delimiter \$.
  5. The extracted string passed to the MathJax renderer is $ y + 0.900 = 9.638 x^{-1.394} $.
  6. MathJax renders the unstripped dollar signs as literal text.

Suggested Fix
  1. Evaluate displayRegex before inlineRegex:
    return findMatch(pos, line, displayRegex) || findMatch(pos, line, inlineRegex);
    
主要言語
TypeScript
スター
657
フォーク
64
平均マージ
20時間 53分
マージ済み PR(30日)
46

環境構築

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

はじめの一歩

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

quarto-dev/quarto のほかの issue

quarto-dev/quarto の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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