overleaf/services/web/frontend/js/features/pdf-preview/util/editor-files.js

5 lines
141 B
JavaScript
Raw Normal View History

const documentClassRe = /^[^%]*\\documentclass/
export const isMainFile = doc =>
doc.split('\n').some(line => documentClassRe.test(line))