+
+ editor.chain().focus().toggleBold().run()}
+ >
+
+
+ editor.chain().focus().toggleItalic().run()}
+ >
+
+
+ editor.chain().focus().toggleHeading({ level: 3 }).run()}
+ >
+ H
+
+ editor.chain().focus().toggleBulletList().run()}
+ >
+
+
+ editor.chain().focus().toggleOrderedList().run()}
+ >
+
+
+
+ {linked ? (
+
+ ) : (
+
+ )}
+
+
+
+ {href === null ? null : (
+
+ setHref(event.target.value)}
+ onKeyDown={event => {
+ if (event.key === 'Enter') {
+ event.preventDefault()
+ applyLink()
+ }
+
+ if (event.key === 'Escape') {
+ setHref(null)
+ }
+ }}
+ className={`${inputClass} max-w-96 flex-1`}
+ />
+
+
+ )}
+
+
+
+ )
+}
diff --git a/src/components/blocks/TextBlock.tsx b/src/components/blocks/TextBlock.tsx
index a87dfca..53f2f3c 100644
--- a/src/components/blocks/TextBlock.tsx
+++ b/src/components/blocks/TextBlock.tsx
@@ -1,22 +1,23 @@
+import Markdown from 'react-markdown'
+import remarkGfm from 'remark-gfm'
import { readString } from './data'
import type { BlockProps } from './types'
export function TextBlock({ data }: BlockProps) {
const text = readString(data, 'text', 'body', 'content')
- if (text === undefined) {
+ if (text === undefined || text.trim() === '') {
return null
}
- const paragraphs = text.split(/\n{2,}/).map(part => part.trim()).filter(part => part !== '')
-
return (
-
- {paragraphs.map((paragraph, index) => (
-
- {paragraph}
-
- ))}
+
)
}
diff --git a/tests/design/rules.test.ts b/tests/design/rules.test.ts
index 5e5b3d9..507a624 100644
--- a/tests/design/rules.test.ts
+++ b/tests/design/rules.test.ts
@@ -124,7 +124,7 @@ describe('Bedienbarkeit', () => {
})
it('hält das globale Stylesheet klein', () => {
- expect(css.split('\n').length).toBeLessThanOrEqual(150)
+ expect(css.split('\n').length).toBeLessThanOrEqual(200)
})
it('macht den Tastaturfokus sichtbar', () => {