client/components/tinymce/plugins/after-the-deadline/plugin.js
function finish() {
		let node,
			regex = new RegExp( 'mceItemHidden|hidden(((Grammar|Spell)Error)|Suggestion)' ),
			nodes = editor.dom.select( 'span' ),
			i = nodes.length;

		while ( i-- ) {
			// reversed
			node = nodes[ i ];

			if ( node.className && regex.test( node.className ) ) {
				editor.dom.remove( node, true );
			}
		}

		// Rebuild the DOM so AtD core can find the text nodes
		editor.setContent( editor.getContent( { format: 'raw' } ), { format: 'raw' } );

		started = false;
		editor.nodeChanged();
		editor.fire( 'SpellcheckEnd' );
	}
function finish() {
		let node,
			regex = new RegExp( 'mceItemHidden|hidden(((Grammar|Spell)Error)|Suggestion)' ),
			nodes = editor.dom.select( 'span' ),
			i = nodes.length;

		while ( i-- ) {
			// reversed
			node = nodes[ i ];

			if ( node.className && regex.test( node.className ) ) {
				editor.dom.remove( node, true );
			}
		}

		// Rebuild the DOM so AtD core can find the text nodes
		editor.setContent( editor.getContent( { format: 'raw' } ), { format: 'raw' } );

		started = false;
		editor.nodeChanged();
		editor.fire( 'SpellcheckEnd' );
	}
Called when the user clicks "Finish" or when no more suggestions left. Removes all remaining spans and fires custom event.