mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Merge pull request #76 from dfelder/patch-1
Ignore commented lines when setting root doc #52
This commit is contained in:
commit
521befddd3
1 changed files with 2 additions and 1 deletions
|
@ -10,7 +10,8 @@ module.exports = ProjectRootDocManager =
|
|||
root_doc_id = null
|
||||
for path, doc of docs
|
||||
for line in doc.lines || []
|
||||
if Path.extname(path).match(/\.R?tex$/) and line.match(/\\documentclass/)
|
||||
match = line.match /(.*)\\documentclass/ # no lookbehind in js regexp :(
|
||||
if Path.extname(path).match(/\.R?tex$/) and match and !match[1].match /%/
|
||||
root_doc_id = doc._id
|
||||
if root_doc_id?
|
||||
ProjectEntityHandler.setRootDoc project_id, root_doc_id, sl_req_id, callback
|
||||
|
|
Loading…
Reference in a new issue