Hello. I wonder that The node spec is possible to config on creation? I couldn’t find related specific example.
Here is my Span node spec example.
const spanSpec = {
inline: true,
group: "inline",
atom:true,
attrs:{
class : {default:'default_class'}
}
}
I want to config the Atom attribute by the class attribute something like this.
const spanSpec = {
inline: true,
group: "inline",
atom: function(){
if( this.attrs.class.indexOf('default_class')!==-1 ){
return true;
}else{
return false;
}
},
attrs:{
class : {default:'default_class'}
}
}
Is there any other easy or appropriate ways of this? Or I should update that Atom attrs after creation? (I think I may miss something.) Any advice would be appreciated.