mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 06:03:45 +01:00
Ignore commented lines when setting root doc #52
Same code I used in public/coffee/pdf/CompiledView.coffee. I didn't test it locally though.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user