@marijn I just found out, is it possible to use new common.NodeProp() for that?
I could parse/iterate the tree, then assign certain NodeProp, and then read that in highlighers/decorators? I found that it’s being used in markdown with headings and foldings - it looks like it’s adding isHeading prop, and then in folding it’s being read.
Okay, then maybe it’s possible to assign tags to the parsed tree conditionally somehow? Something like styleTags(), but that could allow to do somelogic around it?
Something similar to:
styleTags([
function (state) {
if (some logic) {
return tags.monospace;
}
},
{
'InlineCode/...': tags.monospace,
'HTMLBlock HTMLTag Entity': html
}
]);
Is this possible?
Or maybe MatchDecorator, but one that doesn’t take regexp, but a callback to determine whether to style or not? Basically anything I can put between parsing and styling.