You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found that here at line 121 new Component is created with this.color() instead of textComponent.style().color(this.color()) as a second argument, thus styles are lost.
After some debugging I found that text components with is and test contents that are being sent to apply(Component, int) method, are actually {"italic": true, "text": "", "extra": [{"text": "is"}]} and {"bold": true, "text": "", "extra": [{"text": "test"}]} after inner italic and bold tags are applied. Inner {"text": "is"} and {"text": "test"} don't have styles at all, so nothing would be applied even with the fix I described in the previous paragraph.
The text was updated successfully, but these errors were encountered:
Thanks for your thorough investigation! Seems like this is an issue that comes up when you use component placeholders -- internally MM doesn't have multiple style elements on one tag, but I believe your fix should work.
Input
<gradient>This <italic>is</italic> a <bold>test</bold>!</gradient>
Expected output
JSON
Actual (observed) output
JSON
Other information
Version: 4.11.0 (also reproduced at 167e46d which is 4.12.0-SNAPSHOT)
I had some troubles reproducing this sometimes. First time when I found this bug, I was using this code:
and got this output:
I found that here at line 121 new
Component
is created withthis.color()
instead oftextComponent.style().color(this.color())
as a second argument, thus styles are lost.After some debugging I found that text components with
is
andtest
contents that are being sent toapply(Component, int)
method, are actually{"italic": true, "text": "", "extra": [{"text": "is"}]}
and{"bold": true, "text": "", "extra": [{"text": "test"}]}
after inneritalic
andbold
tags are applied. Inner{"text": "is"}
and{"text": "test"}
don't have styles at all, so nothing would be applied even with the fix I described in the previous paragraph.The text was updated successfully, but these errors were encountered: