Sign up (with export icon)

BookmarkConfig

Api-interface icon interface

The configuration of the bookmark feature.

The properties defined in this config are set in the config.bookmark namespace.

ClassicEditor
	.create( editorElement, {
		bookmark: {
			// Bookmark configuration.
		}
	} )
	.then( ... )
	.catch( ... );
Copy code

See all editor options.

Properties

  • Chevron-right icon

    enableNonEmptyAnchorConversion : boolean | undefined

    Allows to convert into bookmarks non-empty anchor elements.

    With this option enabled you will have all non-empty anchors converted into bookmakrs. For example:

    <a id="bookmark">Bookmark</a>
    
    Copy code

    will be converted into:

    <a id="bookmark"></a>Bookmark
    
    Copy code

    Note: This is enabled by default.

    Defaults to true

  • Chevron-right icon

    toolbar : Array<string> | undefined

    Items to be placed in the bookmark contextual toolbar.

    Assuming that you use the BookmarkUI feature, the following toolbar items will be available in ComponentFactory:

    • 'bookmarkPreview',
    • 'editBookmark',
    • 'removeBookmark'.

    The default configuration for bookmark toolbar is:

    const bookmarkConfig = {
    	toolbar: [ 'bookmarkPreview', '|', 'editBookmark', 'removeBookmark' ]
    };
    
    Copy code

    Of course, the same buttons can also be used in the main editor toolbar.

    Read more about configuring the toolbar in toolbar.