mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
feat: implement bullet lists in the editor
This commit is contained in:
parent
3d489c599e
commit
c605c2a8f4
5 changed files with 151 additions and 21 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue