mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-04 06:39:02 +02:00
Merge pull request #2168 from overleaf/pr-restrict-main-file-options
Restrict main file options based on extension. GitOrigin-RevId: f7d7a61c0454621dd8bc6ab5edce8a89721018ea
This commit is contained in:
committed by
sharelatex
parent
6737637b39
commit
ea0270dbdd
@@ -40,7 +40,7 @@ module.exports = ProjectRootDocManager = {
|
||||
(doc, path) =>
|
||||
function(cb) {
|
||||
if (
|
||||
/\.R?tex$/.test(Path.extname(path)) &&
|
||||
ProjectEntityUpdateHandler.isPathValidForRootDoc(path) &&
|
||||
DocumentHelper.contentHasDocumentclass(doc.lines)
|
||||
) {
|
||||
return cb(doc._id)
|
||||
@@ -232,14 +232,11 @@ module.exports = ProjectRootDocManager = {
|
||||
if (rootDocValid) {
|
||||
return callback()
|
||||
} else {
|
||||
return ProjectEntityUpdateHandler.setRootDoc(
|
||||
project_id,
|
||||
null,
|
||||
() =>
|
||||
ProjectRootDocManager.setRootDocAutomatically(
|
||||
project_id,
|
||||
callback
|
||||
)
|
||||
return ProjectEntityUpdateHandler.unsetRootDoc(project_id, () =>
|
||||
ProjectRootDocManager.setRootDocAutomatically(
|
||||
project_id,
|
||||
callback
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user