Skip to content

Cm5TextMarkerOptions

Unofficial

Options for creating a text marker in CodeMirror 5.

Import:

import type { Cm5TextMarkerOptions } from '@obsidian-typings/obsidian-catalyst-latest';

Signature:

export interface Cm5TextMarkerOptions

Properties

PropertyTypeDescription
addToHistory?booleanWhen set to true, adding this marker will create an event in the undo history.
atomic?booleanAtomic ranges act as a single unit when cursor movement is concerned.
attributes?Record<string, string>When given, add the attributes to the elements created for the marked text.
className?stringAssigns a CSS class to the marked stretch of text.
clearOnEnter?booleanWhen enabled, will cause the mark to clear itself whenever the cursor enters its range.
clearWhenEmpty?booleanDetermines whether the mark is automatically cleared when it becomes empty.
collapsed?booleanCollapsed ranges do not show up in the display.
css?stringA string of CSS to be applied to the covered text.
endStyle?stringEquivalent to startStyle, but for the rightmost span.
handleMouseEvents?booleanWhether the editor will capture mouse and drag events occurring in this widget.
inclusiveLeft?booleanDetermines whether text inserted on the left of the marker will end up inside or outside of it.
inclusiveRight?booleanLike inclusiveLeft, but for the right side.
readOnly?booleanA read-only span cannot be modified except by calling setValue.
replacedWith?HTMLElementUse a given node to display this range. Implies both collapsed and atomic.
selectLeft?booleanFor atomic ranges, determines whether the cursor is allowed to be placed directly to the left.
selectRight?booleanLike selectLeft, but for the right side.
shared?booleanWhen set to true, makes the marker appear in all linked documents.
startStyle?stringCan be used to specify an extra CSS class for the leftmost span of the marker.
title?stringWhen given, will give the nodes a HTML title attribute with the given value.