Simple text editor based on tiptap. HTML format.
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 
 

28 行
460 B

  1. import { Mark } from 'tiptap'
  2. import { toggleMark } from 'tiptap-commands'
  3. export default class SuperscriptStyle extends Mark {
  4. get name() {
  5. return 'superscriptstyle'
  6. }
  7. get schema() {
  8. return {
  9. parseDOM: [
  10. {
  11. tag: 'sup',
  12. },
  13. ],
  14. toDOM: () => ['sup', 0],
  15. }
  16. }
  17. commands({ type }) {
  18. return () => toggleMark(type)
  19. }
  20. }