Hi! I’ve found another issue regarding the whitespace character.
I’ve added multiple plugins to my Prosemirror editor that have tokenizing functionalities, based on the changes that occur in a Transaction each plugin creates tokens with positions attached to them, each Plugin stores token objects in the Plugin state witch I then use to create custom inline decorations for each token.
I then extract the tokens from my custom Plugins so that I can pass them to the Constructor of each Plugin when re-initializing the editor so that I preserve the decorations that I have inside my Editor.
My issue is when re-initializing the editor with the existing tokens, I get the correct inline decorations at each token position, but when adding a whitespace character after the last inline decoration, that decoration is disabled and the text is not decorated, although my tokens from the Plugins are not affected and their positions are not modified.
Bellow is an example of the state.init
from one of my custom Plugins that tokenizes operator characters
state: {
init: (_, _state) => {
const decorations = this.options.previousContent
? this.options.previousContent.activeOperators.map(op => {
return Decoration.inline(
op.pos.start,
op.pos.end,
{
style: `color: ${op.color}; font-weight: bold;`,
'data-type': op.type,
'data-sub-type': op.subType
},
{
inclusiveEnd: true,
inclusiveStart: true
}
);
})
: [];
return {
operatorColors: this.options.operatorColors,
operators: this.options.operators,
activeOperators: this.options.previousContent
? this.options.previousContent.activeOperators
: [],
decorations: decorations
};
}