Skip to content

Commit

Permalink
Bring back inline code support
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <jus@bitgrid.net>
  • Loading branch information
juliusknorr committed Jun 9, 2022
1 parent accde76 commit c50650f
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
19 changes: 19 additions & 0 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions src/extensions/RichText.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -65,6 +66,7 @@ export default Extension.create({
Italic,
Strike,
Blockquote,
Code,
CodeBlock,
BulletList,
HorizontalRule,
Expand Down
4 changes: 4 additions & 0 deletions src/tests/markdown.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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)')
Expand Down

0 comments on commit c50650f

Please sign in to comment.