At the risk of asking an “XY” question (about an attempted solution rather than the actual problem), can style rules match on the presence or value of custom data- attributes ?
Context:
I use definition lists (essentially a list of Term rows, each with some Definition children) and I wondered whether I could make definition list terms visually distinct in the editor with a style that matched the presence of something like a data-term="true" attribute value ?
Broader context:
I’m drafting a custom a Lua reader-writer pair for Bike ⇄ Pandoc traffic, and I’m writing Pandoc DefinitionList blocks out to Bike with term rows flagged by an attribute. (In the Bike editor I can add and view custom attributes with an extension or script, but I can’t yet detect their presence in styling – I may have missed a trick or two)
FWIW other custom attributes that might help me with fuller Bike ⇄ Pandoc round-tripping would include things in the region of:
data-table="true"data-figure="true"(for captioned links to images)