Jira macro inline wrapping

I am attempting to write a custom macro which behaves similar to a style tag, that is, it should be considered an “inline” macro and not create it’s own element. There is an issue when inserting the macro in the middle of other macros (such as color), whereby the editor will split the color macro into two parts, making the inline nature of this new macro not work.

Example:

{color:#ff00cc}This is some content{color}

// then applying the macro to "some" splits the sentance:

{color:#ff00cc}This is{color}
{myMacro}some{myMacro}
{color:#ff00cc}content{color}

Does anyone know of a way to get the new macro to be treated as an inline styled macro? In the java implementation class, I have the isInline set to true, but it appears to be more an issue with the fact that it’s a macro inside a macro that is causing issues.