Skip to content

Commit

Permalink
feat: remove <code> supports
Browse files Browse the repository at this point in the history
  • Loading branch information
robertu7 committed Jun 18, 2024
1 parent d35dcb4 commit dc31c5f
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 24 deletions.
22 changes: 2 additions & 20 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 0 additions & 2 deletions src/editors/extensions/index.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -54,7 +53,6 @@ const baseArticleExtensions = (placeholder?: string) => [
Gapcursor,
Bold,
Strike,
Code,
CodeBlock,
HorizontalRule,
OrderedList,
Expand Down
19 changes: 19 additions & 0 deletions src/transformers/normalize.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,21 @@ describe('Normalization: Article', () => {
)
})

test('code is not supported', () => {
expectNormalizeArticleHTML('<p><code>abc</code></p>', '<p>abc</p>')
})

test('code block', () => {
expectNormalizeArticleHTML(
'<pre><code>abc</code></pre>',
'<pre><code>abc</code></pre>',
)
expectNormalizeArticleHTML(
'<pre><code>abc\ndef</code></pre>',
'<pre><code>abc\ndef</code></pre>',
)
})

test('underline', () => {
expectNormalizeArticleHTML(
'<p><u>abc</u></p>',
Expand Down Expand Up @@ -380,6 +395,10 @@ describe('Normalization: Comment', () => {
expectNormalizeCommentHTML('<p><u>abc</u></p>', '<p>abc</p>')
})

test('code is not supported', () => {
expectNormalizeCommentHTML('<p><code>abc</code></p>', '<p>abc</p>')
})

test('self-closed tags', () => {
expectNormalizeCommentHTML('<p />', '<p></p>')

Expand Down

0 comments on commit dc31c5f

Please sign in to comment.