Merge pull request #19373 from overleaf/mj-comment-regex-fix

[web] Fix regex in comment matching

GitOrigin-RevId: e341f13a9ccbe2fbc1ec6c6c1d8a7a11c4dd4e37
This commit is contained in:
Mathias Jakobsen
2024-07-15 09:04:07 +00:00
committed by Copybot
parent 3ebab56455
commit 1f0e346bbc
2 changed files with 4 additions and 7 deletions
@@ -137,11 +137,6 @@ module.exports = MetaHandler = {
* @returns {string}
*/
_getNonCommentedContent(rawLine) {
const commentStart = /(?:^%)|(?:[^\\]%)/
const match = rawLine.match(commentStart)
if (match) {
return rawLine.slice(0, match.index)
}
return rawLine
return rawLine.replace(/(^|[^\\])%.*/, '$1')
},
}