mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #14226 from overleaf/mj-table-gen-reinstate-regex
[visual] Reinstate regex for escaping ampersands GitOrigin-RevId: 61f561fdee0ff9393fb20eb0a0485ce7fbf75bea
This commit is contained in:
parent
be19db03b4
commit
6d8c8e678e
1 changed files with 5 additions and 1 deletions
|
@ -62,7 +62,11 @@ export const Cell: FC<{
|
|||
|
||||
const filterInput = (input: string) => {
|
||||
// TODO: Are there situations where we don't want to filter the input?
|
||||
return input.replaceAll('\\\\', '')
|
||||
return input
|
||||
.replaceAll(/(^&|[^\\]&)/g, match =>
|
||||
match.length === 1 ? '\\&' : `${match[0]}\\&`
|
||||
)
|
||||
.replaceAll('\\\\', '')
|
||||
}
|
||||
|
||||
const isFocused =
|
||||
|
|
Loading…
Reference in a new issue