Skip to content

Tiptap extension for setting custom class of the inline node (mark)

License

Notifications You must be signed in to change notification settings

yaskevich/extension-marker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

extension-marker

Version Downloads License

Tiptap extension for setting custom class of the mark.

Installation

npm install @yaskevich/extension-marker

Settings

classes

The list of the classes available to be set via the extension.

Default: none

shortcuts

The list of the keyboard shortcuts in the same order as the classes.

Default: none

Example: ['Mod-q'] will set Ctrl+Q shortcut for first item.

If you would like to omit shortcut for an item, but set it for next one in list, put there an empty string.

excludes

This option works in the same manner, as it is described in Schema documentation.

'_' excludes all other marks, 'bold' excludes only Bold mark.

Default: marker (excludes setting itself more than once).

tag

The name of the tag into which the mark is rendered

Default: 'span'

It is better not to set something fancy, however, for example I use var tag in one of my projects.

How to set class via button click

Set handler like this:

editor.chain().focus().toggleMarker({ class: 'superclass' }).run()

👾

About

Tiptap extension for setting custom class of the inline node (mark)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published