diff --git a/frontend/src/store/modules/submission-notes.ts b/frontend/src/store/modules/submission-notes.ts index 87f35f37b5d7da9841af4e58cffc94eb8a86d8b7..96688676fc644d0559edda5c014beff1f79057ce 100644 --- a/frontend/src/store/modules/submission-notes.ts +++ b/frontend/src/store/modules/submission-notes.ts @@ -63,7 +63,12 @@ const submissionGetter = mb.read(function submission (state, getters) { ? getters.submissionType.programmingLanguage : 'c' const highlighted = hljs.highlight(language, state.submission.text || '', true).value + + let commentFlag = false return highlighted.split('\n').reduce((acc: {[k: number]: string}, cur, index) => { + if (cur.includes("/*")) commentFlag = true + cur = commentFlag ? '<span class="hljs-comment">' + cur + '</span>' : cur + if (cur.includes("*/")) commentFlag = false // so that the ending line will also be greyed out acc[index + 1] = cur return acc }, {})