Преглед изворни кода

Update \documentclass regex so that it does match on '\documentclass{...} % comment with \documentclass'

James Allen пре 10 година
родитељ
комит
65a42c551d
1 измењених фајлова са 2 додато и 2 уклоњено
  1. 2 2
      services/web/public/coffee/ide/pdf/controllers/PdfController.coffee

+ 2 - 2
services/web/public/coffee/ide/pdf/controllers/PdfController.coffee

@@ -109,8 +109,8 @@ define [
 			doc = ide.editorManager.getCurrentDocValue()
 			doc = ide.editorManager.getCurrentDocValue()
 			return null if !doc?
 			return null if !doc?
 			for line in doc.split("\n")
 			for line in doc.split("\n")
-				match = line.match /(.*)\\documentclass/
-				if match and !match[1].match /%/
+				match = line.match /^[^%]*\\documentclass/
+				if match
 					return ide.editorManager.getCurrentDocId()
 					return ide.editorManager.getCurrentDocId()
 			return null
 			return null