Skip to content

Commit

Permalink
Fix \verb support inside math mode
Browse files Browse the repository at this point in the history
`$` inside `\verb` was being treated as a math delimiter
  • Loading branch information
edemaine committed Dec 14, 2023
1 parent 9744bfa commit fd7c3d8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ instead of version numbers.
## 2023-12-14

* Copy/pasting a URL from a message no longer adds extraneous zero-width spaces
* `\verb|$|` now works inside math mode

## 2023-12-05

Expand Down
2 changes: 1 addition & 1 deletion lib/formats.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ escapeForQuotedHTML = (s) ->
replaceMathBlocks = (text, replacer) ->
#console.log text
blocks = []
re = /[{}]|\$\$?|\\(begin|end)\s*{((?:equation|eqnarray|align|alignat|gather|CD)\*?)}|(\\par(?![a-zA-Z])|\n[ \f\r\t\v]*\n\s*)|\\./g
re = /[{}]|\$\$?|\\(begin|end)\s*{((?:equation|eqnarray|align|alignat|gather|CD)\*?)}|(\\par(?![a-zA-Z])|\n[ \f\r\t\v]*\n\s*)|\\verb(.).*?\4|\\./g
block = null
startBlock = (b) ->
block = b
Expand Down

0 comments on commit fd7c3d8

Please sign in to comment.