Skip to content

Commit

Permalink
remove support for dollar surrounding backtick
Browse files Browse the repository at this point in the history
  • Loading branch information
Roms1383 committed Jun 13, 2024
1 parent c8632c4 commit d55ac5d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
3 changes: 0 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -643,9 +643,6 @@ where
let check = if checked { "x" } else { " " };
write!(formatter, "[{}] ", check)
}
InlineMath(ref text) if text.contains(r"\$") && (text.starts_with('`').not() && text.ends_with('`').not()) => {
write!(formatter, "$`{}`$", text)
}
InlineMath(ref text) => write!(formatter, "${}$", text),
DisplayMath(ref text) => write!(formatter, "$${}$$", text),
}
Expand Down
2 changes: 1 addition & 1 deletion tests/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ fn math() {
s(Event::InlineMath(r##"\sqrt{3x-1}+(1+x)^2"##.into())),
r##"$\sqrt{3x-1}+(1+x)^2$"##
);
assert_eq!(s(Event::InlineMath(r##"\sqrt{\$4}"##.into())), r##"$`\sqrt{\$4}`$"##);
assert_eq!(s(Event::InlineMath(r##"\sqrt{\$4}"##.into())), r##"$\sqrt{\$4}$"##);
assert_eq!(s(
Event::DisplayMath(
r##"\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)"##.into()
Expand Down
6 changes: 3 additions & 3 deletions tests/fixtures/snapshots/stupicat-math-output
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ either$

`$` character can be escaped with backslash in mathematical expressions:

$`\$`$
$\$$

$$y = \$ x$$

Expand Down Expand Up @@ -213,7 +213,7 @@ $$$$\\text{first $$ second}$$

Dollar signs must also be backslash-escaped if they occur within math:

$`\text{\$}`$
$\text{\$}$

$$x$x$$

Expand Down Expand Up @@ -327,7 +327,7 @@ $$ x = {-b \pm \sqrt{b^2-4ac} \over 2a} $$

Spacing around dollar sign in math mode

$`x = \$`$
$x = \$$

Math in italic text

Expand Down

0 comments on commit d55ac5d

Please sign in to comment.