Closed Tofpu closed 6 months ago
From what I can tell, this PR is ready now. Feel free to test the changes out when y'all could. I'm open to any feedback as usual! :)
Hi @Tofpu, I'm going to merge this PR into a branch inside of the mc-utils repo so that it deploys a preview branch. I'll make a new PR afterwards to be reviewed. Thanks :)
Written from scratch to apply the colors algorithmically. From what I understand, we are not able to reliable remove inherited decorations purely via CSS, as seen in issue https://github.com/flytegg/mc-utils/issues/200. So I went with a systematic approach to eliminate the decorations' inheritance problem once and for all by iterating through each char of given input and handling it appropriately.
Regarding tests, I tested the test cases mentioned in PR with this changes and compared it in-game and I can confirm that everything matches. I also introduced couple more tests below to verify that multi lines and gradient works as expected.
Since this completely changes how we apply the colors, we need to make sure this works as expected😄
A quick comparison:
Input: &cFirst Test&r &eSecond Fourth
Current:
Now:
In game:
Test cases (built on top of previous PR):