mirror of
https://github.com/openai/codex.git
synced 2026-11-19 22:30:42 +00:00
Render \widetilde in terminal Markdown math (#62554)
## What changed
Apply the same Unicode combining tilde as `\tilde` when the
`\widetilde` argument is a single grapheme.
## Testing
Extend the Unicode math snapshot to cover both `\widetilde{I}` and
`\widetilde I` in fraction numerators.
GitOrigin-RevId: e6976f998bb0955ba9c73117bd19dd814b07399a
This commit is contained in:
@@ -304,7 +304,7 @@ impl MathParser<'_> {
|
||||
};
|
||||
Some(Layout::text(text))
|
||||
}
|
||||
"hat" | "widehat" | "bar" | "tilde" | "vec" | "dot" | "ddot" => {
|
||||
"hat" | "widehat" | "bar" | "tilde" | "widetilde" | "vec" | "dot" | "ddot" => {
|
||||
let arg = self.argument()?;
|
||||
let text = arg.single()?;
|
||||
if text.graphemes(/*is_extended*/ true).count() != 1
|
||||
@@ -316,7 +316,7 @@ impl MathParser<'_> {
|
||||
let accent = match name {
|
||||
"hat" | "widehat" => '\u{0302}',
|
||||
"bar" => '\u{0304}',
|
||||
"tilde" => '\u{0303}',
|
||||
"tilde" | "widetilde" => '\u{0303}',
|
||||
"vec" => '\u{20d7}',
|
||||
"dot" => '\u{0307}',
|
||||
"ddot" => '\u{0308}',
|
||||
|
||||
@@ -27,6 +27,14 @@ $$
|
||||
x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}
|
||||
$$
|
||||
|
||||
$$
|
||||
I'=\frac{\widetilde{I}}{\rho}
|
||||
$$
|
||||
|
||||
$$
|
||||
I'=\frac{\widetilde I}{\rho}
|
||||
$$
|
||||
|
||||
$$\frac{1}{2}\frac{3}{4}$$
|
||||
|
||||
$$
|
||||
|
||||
+8
@@ -8,6 +8,14 @@ The spectrum is λ₁ ≤ λ₂ on ℝⁿ.
|
||||
x=────────────
|
||||
2a
|
||||
|
||||
Ĩ
|
||||
I'=─
|
||||
ρ
|
||||
|
||||
Ĩ
|
||||
I'=─
|
||||
ρ
|
||||
|
||||
1 3
|
||||
─ ─
|
||||
2 4
|
||||
|
||||
Reference in New Issue
Block a user