Merge pull request #18676 from overleaf/mj-web-linter-document-class

[web] Allow underscore in optional argument in \documentclass

GitOrigin-RevId: c6f8716548411ade03814c8123df76fa8aa70ecc
This commit is contained in:
Mathias Jakobsen
2024-06-10 08:04:11 +00:00
committed by Copybot
parent 2247f02308
commit f0eba8e742
4 changed files with 47 additions and 4 deletions
@@ -494,6 +494,23 @@ describe('LatexLinter', function () {
assert.equal(errors[0].text, 'unclosed group {')
})
it('should accept documentclass with no options', function () {
const { errors } = Parse('\\documentclass{article}')
assert.equal(errors.length, 0)
})
it('should accept documentclass with options', function () {
const { errors } = Parse('\\documentclass[a4paper]{article}')
assert.equal(errors.length, 0)
})
it('should accept documentclass with underscore in options', function () {
const { errors } = Parse(
'\\documentclass[my_custom_document_class_option]{my-custom-class}'
)
assert.equal(errors.length, 0)
})
// %novalidate
// %begin novalidate
// %end novalidate