diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-31 12:08:17 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-31 12:08:17 +0300 |
commit | dcbe65b8b6d3be931c10a823d1271318f70b1507 (patch) | |
tree | bd4da373dd9dc1d4ad8605960ea02f46198d8356 /app/assets/javascripts/vue_shared/components/source_viewer | |
parent | a9f214d42107c847fcc8fb2a5dff78ba17363e41 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/vue_shared/components/source_viewer')
-rw-r--r-- | app/assets/javascripts/vue_shared/components/source_viewer/plugins/wrap_comments.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/assets/javascripts/vue_shared/components/source_viewer/plugins/wrap_comments.js b/app/assets/javascripts/vue_shared/components/source_viewer/plugins/wrap_comments.js index 4a18733de94..5be92af5b55 100644 --- a/app/assets/javascripts/vue_shared/components/source_viewer/plugins/wrap_comments.js +++ b/app/assets/javascripts/vue_shared/components/source_viewer/plugins/wrap_comments.js @@ -24,12 +24,13 @@ export default (result) => { result.value = result.value // Highlight.js expects the result param to be mutated for plugins to work .split('\n') .map((lineContent) => { - if (lineContent.includes(HLJS_COMMENT_SELECTOR)) { + const includesClosingTag = lineContent.includes('</span>'); + if (lineContent.includes(HLJS_COMMENT_SELECTOR) && !includesClosingTag) { wrapComment = true; return lineContent; } const line = wrapComment ? createWrapper(lineContent) : lineContent; - if (lineContent.includes('</span>')) { + if (includesClosingTag) { wrapComment = false; } return line; |