зеркало из https://github.com/nextcloud/text.git
Bring back inline code support
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Родитель
4f7ee3db62
Коммит
44ea404ce5
|
@ -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)')
|
||||
|
|
Загрузка…
Ссылка в новой задаче