Implementing un-blockquote

I’m struggling to write an ‘unblockquote’ command, that is to reduce by one the ‘depth’ of the current blockquote.

What I am trying to achieve is text indent/outdent commands, following gmail I implemented indent as a blockquote with no border and margins which works really well but now I need an outdent command. I looked at the code for liftListItem but I’m not sure of how to follow it.

I wanted to ask for any tips or code as I’m sure this will be generally useful.


oh, looking at the basic example it seems liftListItem just works perfectly for blockquotes as is ! great :slight_smile:

Perhaps it’s name can be changed as it’s not limited to lists ?

liftListItems does have list-specific logic, but the lift command in the prosemirror-commands module probably does what you want.

great, I ended up with:

	let liftCommand=chainCommands(liftListItem(schema.nodes.list_item), lift);

	// :: MenuItem
	// Menu item for the `lift` command.
	const liftItem = new MenuItem({
		title: "outdent",
		run: (state, dispatch) => {
			liftCommand(state, dispatch)
		select: state => liftCommand(state),
		icon: icons.lift