mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-25 06:43:58 +00:00
Allow citations like -parencite[page 6]{
to work.
This commit is contained in:
parent
c7da9f1eef
commit
059d3432c2
1 changed files with 2 additions and 2 deletions
|
@ -7,7 +7,7 @@ define [
|
|||
Range = ace.require("ace/range").Range
|
||||
|
||||
getLastCommandFragment = (lineUpToCursor) ->
|
||||
if m = lineUpToCursor.match(/(\\[^\\ ]+)$/)
|
||||
if m = lineUpToCursor.match(/(\\[^\\]+)$/)
|
||||
return m[1]
|
||||
else
|
||||
return null
|
||||
|
@ -47,7 +47,7 @@ define [
|
|||
lineUpToCursor = editor.getSession().getTextRange(upToCursorRange)
|
||||
commandFragment = getLastCommandFragment(lineUpToCursor)
|
||||
if commandFragment
|
||||
citeMatch = commandFragment.match(/^~?\\([a-z]*cite[a-z]?){([^}]*,)?(\w*)/)
|
||||
citeMatch = commandFragment.match(/^~?\\([a-z]*cite[a-z]?(?:\[.*])?){([^}]*,)?(\w*)/)
|
||||
if citeMatch
|
||||
beyondCursorRange = new Range(pos.row, pos.column, pos.row, 99999)
|
||||
lineBeyondCursor = editor.getSession().getTextRange(beyondCursorRange)
|
||||
|
|
Loading…
Reference in a new issue