Simple text editor based on tiptap. HTML format.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

32 lines
612 B

  1. import { Mark } from 'tiptap'
  2. import { toggleMark } from 'tiptap-commands'
  3. export default class SubscriptStyle extends Mark {
  4. get name() {
  5. return 'subscriptstyle'
  6. }
  7. get schema() {
  8. return {
  9. parseDOM: [
  10. {
  11. tag: 'sub',
  12. },
  13. //{
  14. // style: 'text-decoration',
  15. // getAttrs: value => value === 'underline',
  16. // },
  17. ],
  18. toDOM: () => ['sub', 0],
  19. }
  20. }
  21. commands({ type }) {
  22. return () => toggleMark(type)
  23. }
  24. }