diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-09 00:20:24 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-09 00:20:24 +0300 |
commit | 94cb5cf7da670f11b320741a1c1c8605abcb86d7 (patch) | |
tree | ab787d56484ec72d9f475718107cd95e9f30cee4 /app/assets/javascripts/content_editor | |
parent | 2fc7db3159afc0d67a60dbe76e27df93078f33ca (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/content_editor')
-rw-r--r-- | app/assets/javascripts/content_editor/services/markdown_sourcemap.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/assets/javascripts/content_editor/services/markdown_sourcemap.js b/app/assets/javascripts/content_editor/services/markdown_sourcemap.js index a1199589c9b..4285e04bbab 100644 --- a/app/assets/javascripts/content_editor/services/markdown_sourcemap.js +++ b/app/assets/javascripts/content_editor/services/markdown_sourcemap.js @@ -1,7 +1,9 @@ -const getFullSource = (element) => { +import { isString } from 'lodash'; + +export const getFullSource = (element) => { const commentNode = element.ownerDocument.body.lastChild; - if (commentNode.nodeName === '#comment') { + if (commentNode?.nodeName === '#comment' && isString(commentNode.textContent)) { return commentNode.textContent.split('\n'); } |