diff --git a/package-lock.json b/package-lock.json index 1e835d2..8d933d1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,18 +1,17 @@ { "name": "@matters/matters-editor", - "version": "0.2.5-alpha.6", + "version": "0.2.5-alpha.8", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@matters/matters-editor", - "version": "0.2.5-alpha.6", + "version": "0.2.5-alpha.8", "license": "MIT", "dependencies": { "@tiptap/core": "2.4.0", "@tiptap/extension-blockquote": "2.4.0", "@tiptap/extension-bullet-list": "2.4.0", - "@tiptap/extension-code": "2.4.0", "@tiptap/extension-code-block": "2.4.0", "@tiptap/extension-document": "2.4.0", "@tiptap/extension-gapcursor": "2.4.0", @@ -1366,18 +1365,6 @@ "@tiptap/core": "^2.0.0" } }, - "node_modules/@tiptap/extension-code": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@tiptap/extension-code/-/extension-code-2.4.0.tgz", - "integrity": "sha512-wjhBukuiyJMq4cTcK3RBTzUPV24k5n1eEPlpmzku6ThwwkMdwynnMGMAmSF3fErh3AOyOUPoTTjgMYN2d10SJA==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/ueberdosis" - }, - "peerDependencies": { - "@tiptap/core": "^2.0.0" - } - }, "node_modules/@tiptap/extension-code-block": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/@tiptap/extension-code-block/-/extension-code-block-2.4.0.tgz", @@ -10927,11 +10914,6 @@ "resolved": "https://registry.npmjs.org/@tiptap/extension-bullet-list/-/extension-bullet-list-2.4.0.tgz", "integrity": "sha512-9S5DLIvFRBoExvmZ+/ErpTvs4Wf1yOEs8WXlKYUCcZssK7brTFj99XDwpHFA29HKDwma5q9UHhr2OB2o0JYAdw==" }, - "@tiptap/extension-code": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@tiptap/extension-code/-/extension-code-2.4.0.tgz", - "integrity": "sha512-wjhBukuiyJMq4cTcK3RBTzUPV24k5n1eEPlpmzku6ThwwkMdwynnMGMAmSF3fErh3AOyOUPoTTjgMYN2d10SJA==" - }, "@tiptap/extension-code-block": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/@tiptap/extension-code-block/-/extension-code-block-2.4.0.tgz", diff --git a/package.json b/package.json index 05907d9..5bedcc2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@matters/matters-editor", - "version": "0.2.5-alpha.7", + "version": "0.2.5-alpha.8", "description": "Editor for matters.news", "author": "https://github.com/thematters", "homepage": "https://github.com/thematters/matters-editor", @@ -37,7 +37,6 @@ "@tiptap/core": "2.4.0", "@tiptap/extension-blockquote": "2.4.0", "@tiptap/extension-bullet-list": "2.4.0", - "@tiptap/extension-code": "2.4.0", "@tiptap/extension-code-block": "2.4.0", "@tiptap/extension-document": "2.4.0", "@tiptap/extension-gapcursor": "2.4.0", diff --git a/src/editors/extensions/index.ts b/src/editors/extensions/index.ts index 1219b8b..6497b5e 100644 --- a/src/editors/extensions/index.ts +++ b/src/editors/extensions/index.ts @@ -1,5 +1,4 @@ import BulletList from '@tiptap/extension-bullet-list' -import Code from '@tiptap/extension-code' import CodeBlock from '@tiptap/extension-code-block' import Document from '@tiptap/extension-document' import Gapcursor from '@tiptap/extension-gapcursor' @@ -54,7 +53,6 @@ const baseArticleExtensions = (placeholder?: string) => [ Gapcursor, Bold, Strike, - Code, CodeBlock, HorizontalRule, OrderedList, diff --git a/src/transformers/normalize.test.ts b/src/transformers/normalize.test.ts index eca9fc7..eadc440 100644 --- a/src/transformers/normalize.test.ts +++ b/src/transformers/normalize.test.ts @@ -64,6 +64,21 @@ describe('Normalization: Article', () => { ) }) + test('code is not supported', () => { + expectNormalizeArticleHTML('

abc

', '

abc

') + }) + + test('code block', () => { + expectNormalizeArticleHTML( + '
abc
', + '
abc
', + ) + expectNormalizeArticleHTML( + '
abc\ndef
', + '
abc\ndef
', + ) + }) + test('underline', () => { expectNormalizeArticleHTML( '

abc

', @@ -380,6 +395,10 @@ describe('Normalization: Comment', () => { expectNormalizeCommentHTML('

abc

', '

abc

') }) + test('code is not supported', () => { + expectNormalizeCommentHTML('

abc

', '

abc

') + }) + test('self-closed tags', () => { expectNormalizeCommentHTML('

', '

')