Bring back inline code support

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2022-06-09 21:34:10 +02:00 коммит произвёл max-nextcloud (Rebase PR Action)
Родитель 4f7ee3db62
Коммит 44ea404ce5
4 изменённых файлов: 26 добавлений и 0 удалений

19
package-lock.json сгенерированный
Просмотреть файл

@ -16,6 +16,7 @@
"@tiptap/extension-blockquote": "^2.0.0-beta.26",
"@tiptap/extension-bold": "^2.0.0-beta.26",
"@tiptap/extension-bullet-list": "^2.0.0-beta.26",
"@tiptap/extension-code": "^2.0.0-beta.26",
"@tiptap/extension-code-block": "^2.0.0-beta.37",
"@tiptap/extension-code-block-lowlight": "^2.0.0-beta.68",
"@tiptap/extension-document": "^2.0.0-beta.15",
@ -3505,6 +3506,18 @@
"@tiptap/core": "^2.0.0-beta.1"
}
},
"node_modules/@tiptap/extension-code": {
"version": "2.0.0-beta.26",
"resolved": "https://registry.npmjs.org/@tiptap/extension-code/-/extension-code-2.0.0-beta.26.tgz",
"integrity": "sha512-QcFWdEFfbJ1n5UFFBD17QPPAJ3J5p/b7XV484u0shCzywO7aNPV32QeHy1z0eMoyZtCbOWf6hg/a7Ugv8IwpHw==",
"funding": {
"type": "github",
"url": "https://github.com/sponsors/ueberdosis"
},
"peerDependencies": {
"@tiptap/core": "^2.0.0-beta.1"
}
},
"node_modules/@tiptap/extension-code-block": {
"version": "2.0.0-beta.37",
"resolved": "https://registry.npmjs.org/@tiptap/extension-code-block/-/extension-code-block-2.0.0-beta.37.tgz",
@ -22328,6 +22341,12 @@
"integrity": "sha512-1n5HV8gY1tLjPk4x48nva6SZlFHoPlRfF6pqSu9JcJxPO7FUSPxUokuz4swYNe0LRrtykfyNz44dUcxKVhoFow==",
"requires": {}
},
"@tiptap/extension-code": {
"version": "2.0.0-beta.26",
"resolved": "https://registry.npmjs.org/@tiptap/extension-code/-/extension-code-2.0.0-beta.26.tgz",
"integrity": "sha512-QcFWdEFfbJ1n5UFFBD17QPPAJ3J5p/b7XV484u0shCzywO7aNPV32QeHy1z0eMoyZtCbOWf6hg/a7Ugv8IwpHw==",
"requires": {}
},
"@tiptap/extension-code-block": {
"version": "2.0.0-beta.37",
"resolved": "https://registry.npmjs.org/@tiptap/extension-code-block/-/extension-code-block-2.0.0-beta.37.tgz",

Просмотреть файл

@ -40,6 +40,7 @@
"@tiptap/extension-blockquote": "^2.0.0-beta.26",
"@tiptap/extension-bold": "^2.0.0-beta.26",
"@tiptap/extension-bullet-list": "^2.0.0-beta.26",
"@tiptap/extension-code": "^2.0.0-beta.26",
"@tiptap/extension-code-block": "^2.0.0-beta.37",
"@tiptap/extension-code-block-lowlight": "^2.0.0-beta.68",
"@tiptap/extension-document": "^2.0.0-beta.15",

Просмотреть файл

@ -29,6 +29,7 @@ import Text from '@tiptap/extension-text'
import Blockquote from '@tiptap/extension-blockquote'
import OrderedList from '@tiptap/extension-ordered-list'
import ListItem from '@tiptap/extension-list-item'
import Code from '@tiptap/extension-code'
import CodeBlock from '@tiptap/extension-code-block'
import HorizontalRule from '@tiptap/extension-horizontal-rule'
import Dropcursor from '@tiptap/extension-dropcursor'
@ -65,6 +66,7 @@ export default Extension.create({
Italic,
Strike,
Blockquote,
Code,
CodeBlock,
BulletList,
HorizontalRule,

Просмотреть файл

@ -68,6 +68,7 @@ describe('Markdown though editor', () => {
expect(markdownThroughEditor('__Test__')).toBe('__Test__')
expect(markdownThroughEditor('_Test_')).toBe('*Test*')
expect(markdownThroughEditor('~~Test~~')).toBe('~~Test~~')
expect(markdownThroughEditor('Have an `inline code` element')).toBe('Have an `inline code` element')
})
test('ul', () => {
expect(markdownThroughEditor('- foo\n- bar')).toBe('* foo\n* bar')
@ -89,6 +90,9 @@ describe('Markdown though editor', () => {
test('special characters', () => {
expect(markdownThroughEditor('"\';&.-#><')).toBe('"\';&.-#><')
})
test('code block', () => {
expect(markdownThroughEditor('```\n<?php echo "Hello World";\n```')).toBe('```\n<?php echo "Hello World";\n```')
})
test('checkboxes', () => {
expect(markdownThroughEditor('- [ ] [asd](sdf)')).toBe('* [ ] [asd](sdf)')
expect(markdownThroughEditor('- [x] [asd](sdf)')).toBe('* [x] [asd](sdf)')