feat: implement bullet lists in the editor

This commit is contained in:
swve 2025-04-18 15:24:06 +02:00
parent 3d489c599e
commit c605c2a8f4
5 changed files with 151 additions and 21 deletions

View file

@ -35,7 +35,6 @@ import { getCourseThumbnailMediaDirectory } from '@services/media/media'
import { getLinkExtension } from './EditorConf'
import { Link as LinkExtension } from '@tiptap/extension-link'
// Lowlight
import { common, createLowlight } from 'lowlight'
const lowlight = createLowlight(common)
@ -97,7 +96,18 @@ function Editor(props: Editor) {
const editor: any = useEditor({
editable: true,
extensions: [
StarterKit,
StarterKit.configure({
bulletList: {
HTMLAttributes: {
class: 'bullet-list',
},
},
orderedList: {
HTMLAttributes: {
class: 'ordered-list',
},
},
}),
InfoCallout.configure({
editable: true,
}),
@ -580,6 +590,13 @@ export const EditorContentWrapper = styled.div`
ol {
padding: 0 1rem;
padding-left: 20px;
}
ul {
list-style-type: disc;
}
ol {
list-style-type: decimal;
}