[VS Code] Single-line display math ($$...$$) renders with literal dollar signs in "Quarto: Equation" assist preview
メンテナーはふだん 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 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
- Open a
.qmddocument in VS Code with the Quarto extension installed and enabled. - Type a display math equation on a single line, for example:
$$ y + 0.900 = 9.638 x^{-1.394} $$ - Place the cursor anywhere within or on that line.
- 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:/\$([^ ].*?[^ ]?)\$/gdisplayRegex:/\$\$([^\n]+?)\$\$/
When scanning a line containing single-line display math like $$ y + 0.900 = 9.638 x^{-1.394} $$:
- The inline regex (
inlineRegex) matches first. - The 1st
$satisfies the opening delimiter\$. - The 2nd
$(not being whitespace[^ ]) is treated as the start of the formula text group([^ ].*?[^ ]?). - The 3rd
$satisfies the closing delimiter\$. - The extracted string passed to the MathJax renderer is
$ y + 0.900 = 9.638 x^{-1.394} $. - MathJax renders the unstripped dollar signs as literal text.
Suggested Fix
- Evaluate
displayRegexbeforeinlineRegex:return findMatch(pos, line, displayRegex) || findMatch(pos, line, inlineRegex);
- 主要言語
- TypeScript
- スター
- 657
- フォーク
- 64
- 平均マージ
- 20時間 53分
- マージ済み PR(30日)
- 46
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
quarto-dev/quarto のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
quarto-dev/quarto#1139 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 90/100
quarto-dev/quarto#1138 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
quarto-dev/quarto#1137 ·
メンテナーはふだん 1 日以内に返信
-
Add dependabot?再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
quarto-dev/quarto#1135 ·
メンテナーはふだん 1 日以内に返信
-
vscode
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
quarto-dev/quarto#934 · コメント 1 件 · リアクション 2 件 ·
メンテナーはふだん 1 日以内に返信
quarto-dev/quarto の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
galaxyproject/loom#616 ·
メンテナーはふだん 1 日以内に返信
-
e2e-failure ready-to-code
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
redhat-developer/rhdh-plugin-export-overlays#4580 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 84/100
eknowledger/toolbench#266 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
devdotfast/whiteboard#1415 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信