diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-30 03:09:38 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-30 03:09:38 +0300 |
commit | 1f520d0c7af6a429e7bfb046a8c3ccc6920ef730 (patch) | |
tree | 3403e3689905fab48a13c321fedf7a0be3c2903f /app/assets/javascripts/content_editor | |
parent | cb37aee9894007e60893693d5d48199ea0f0958f (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/create_content_editor.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/app/assets/javascripts/content_editor/services/create_content_editor.js b/app/assets/javascripts/content_editor/services/create_content_editor.js index a7e6bb8d5a2..28041504e3c 100644 --- a/app/assets/javascripts/content_editor/services/create_content_editor.js +++ b/app/assets/javascripts/content_editor/services/create_content_editor.js @@ -59,6 +59,7 @@ import WordBreak from '../extensions/word_break'; import { ContentEditor } from './content_editor'; import createMarkdownSerializer from './markdown_serializer'; import createGlApiMarkdownDeserializer from './gl_api_markdown_deserializer'; +import createRemarkMarkdownDeserializer from './remark_markdown_deserializer'; import trackInputRulesAndShortcuts from './track_input_rules_and_shortcuts'; import languageLoader from './code_block_language_loader'; @@ -146,7 +147,11 @@ export const createContentEditor = ({ const trackedExtensions = allExtensions.map(trackInputRulesAndShortcuts); const tiptapEditor = createTiptapEditor({ extensions: trackedExtensions, ...tiptapOptions }); const serializer = createMarkdownSerializer({ serializerConfig }); - const deserializer = createGlApiMarkdownDeserializer({ render: renderMarkdown }); + const deserializer = window.gon?.features?.preserveUnchangedMarkdown + ? createRemarkMarkdownDeserializer() + : createGlApiMarkdownDeserializer({ + render: renderMarkdown, + }); return new ContentEditor({ tiptapEditor, serializer, eventHub, deserializer, languageLoader }); }; |