nl_tokens: Called when the user clicks Finish or when no more suggestions left . Removes all remaining spans and fires custom event .
pl_tokens: function finish ( ) { let node , regex = new RegExp ( 'mceItemHidden|hidden(((Grammar|Spell)Error)|Suggestion)' ) , nodes = editor . dom . <mask> ( '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' ) ; }