mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-08 00:13:32 +00:00
Use existential operator to check existence
This commit is contained in:
parent
415de9e2ec
commit
96d269e348
1 changed files with 3 additions and 3 deletions
|
@ -183,11 +183,11 @@ define [
|
|||
editor.session.remove(right);
|
||||
# trim the completion text to just the command, without braces
|
||||
# example: '\cite{}' -> '\cite'
|
||||
if matchData.snippet
|
||||
if matchData.snippet?
|
||||
matchData.snippet = matchData.snippet.replace(/[{\[].*[}\]]/, '')
|
||||
if matchData.caption
|
||||
if matchData.caption?
|
||||
matchData.caption = matchData.caption.replace(/[{\[].*[}\]]/, '')
|
||||
if matchData.value
|
||||
if matchData.value?
|
||||
matchData.value = matchData.value.replace(/[{\[].*[}\]]/, '')
|
||||
# finally, insert the match
|
||||
if matchData.snippet
|
||||
|
|
Loading…
Add table
Reference in a new issue