فهرست منبع

Allow citations like `-parencite[page 6]{` to work.

Shane Kilkelly 10 سال پیش
والد
کامیت
059d3432c2
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 2
      services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/AutoCompleteManager.coffee

+ 2 - 2
services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/AutoCompleteManager.coffee

@@ -7,7 +7,7 @@ define [
 	Range = ace.require("ace/range").Range
 	Range = ace.require("ace/range").Range
 
 
 	getLastCommandFragment = (lineUpToCursor) ->
 	getLastCommandFragment = (lineUpToCursor) ->
-		if m = lineUpToCursor.match(/(\\[^\\ ]+)$/)
+		if m = lineUpToCursor.match(/(\\[^\\]+)$/)
 			return m[1]
 			return m[1]
 		else
 		else
 			return null
 			return null
@@ -47,7 +47,7 @@ define [
 					lineUpToCursor = editor.getSession().getTextRange(upToCursorRange)
 					lineUpToCursor = editor.getSession().getTextRange(upToCursorRange)
 					commandFragment = getLastCommandFragment(lineUpToCursor)
 					commandFragment = getLastCommandFragment(lineUpToCursor)
 					if commandFragment
 					if commandFragment
-						citeMatch = commandFragment.match(/^~?\\([a-z]*cite[a-z]?){([^}]*,)?(\w*)/)
+						citeMatch = commandFragment.match(/^~?\\([a-z]*cite[a-z]?(?:\[.*])?){([^}]*,)?(\w*)/)
 						if citeMatch
 						if citeMatch
 							beyondCursorRange = new Range(pos.row, pos.column, pos.row, 99999)
 							beyondCursorRange = new Range(pos.row, pos.column, pos.row, 99999)
 							lineBeyondCursor = editor.getSession().getTextRange(beyondCursorRange)
 							lineBeyondCursor = editor.getSession().getTextRange(beyondCursorRange)