Skip to content

Combining Bold + Italic removes Bold formatting #708

Description

@matthewpagacik12

When trying to add both bold and italic to the same highlight it removes the bold characters. See video below:

Screen.Recording.2026-05-28.at.9.16.55.AM.mov

A workaround could be adding a function similar to the one below:

	const italicExecute: ICommand['execute'] = (state, api, ...rest) => {
		const { text, selection } = state;
		const insideBold =
			selection.start !== selection.end &&
			text.slice(selection.start - 2, selection.start) === '**' &&
			text.slice(selection.end, selection.end + 2) === '**';

		if (insideBold) {
			api.replaceSelection(`*${text.slice(selection.start, selection.end)}*`);
			api.setSelectionRange({ start: selection.start + 1, end: selection.end + 1 });
			return;
		}
		commands.italic.execute?.(state, api, ...rest);
	};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions