Commit ee7abb7b authored by Olena Horal-Koretska's avatar Olena Horal-Koretska

Merge branch '345425-fix-frontmatter-codeblock-highlight-conflict' into 'master'

Resolve "Undefined code blocks and strange rendering in the Content Editor"

See merge request gitlab-org/gitlab!74520
parents 4fe9a92a fcc0f654
...@@ -17,4 +17,7 @@ export default CodeBlockHighlight.extend({ ...@@ -17,4 +17,7 @@ export default CodeBlockHighlight.extend({
addNodeView() { addNodeView() {
return new VueNodeViewRenderer(FrontmatterWrapper); return new VueNodeViewRenderer(FrontmatterWrapper);
}, },
addInputRules() {
return [];
},
}); });
import Frontmatter from '~/content_editor/extensions/frontmatter';
import { createTestEditor, createDocBuilder, triggerNodeInputRule } from '../test_utils';
describe('content_editor/extensions/frontmatter', () => {
let tiptapEditor;
let doc;
let p;
beforeEach(() => {
tiptapEditor = createTestEditor({ extensions: [Frontmatter] });
({
builders: { doc, p },
} = createDocBuilder({
tiptapEditor,
names: {
frontmatter: { nodeType: Frontmatter.name },
},
}));
});
it('does not insert a frontmatter block when executing code block input rule', () => {
const expectedDoc = doc(p(''));
const inputRuleText = '``` ';
triggerNodeInputRule({ tiptapEditor, inputRuleText });
expect(tiptapEditor.getJSON()).toEqual(expectedDoc.toJSON());
});
});
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment