Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formatting codes not applying to correct sections of text #482

Closed
TheBentoBox opened this issue Apr 10, 2017 · 1 comment
Closed

Formatting codes not applying to correct sections of text #482

TheBentoBox opened this issue Apr 10, 2017 · 1 comment
Labels
bug An issue that needs to be fixed. Alternatively, a PR fixing an issue.

Comments

@TheBentoBox
Copy link
Member

TheBentoBox commented Apr 10, 2017

Hello

In dev26c, ampersand color codes are once again functioning, and we are getting closer to it working properly. However, ALL formatting codes are behaving strangely; this includes JSON tags, and formatting codes using the angled bracket notation (e.g. <green> as opposed to &2).

Example Test

I recorded a video here. This is the code that is being run:

send "Part One <green> Part Two <tooltip:test> Part Three <reset> Part Four &2 Part Five <strikethrough> Part Six <yellow> Part Seven" to the player

Here, we can see a couple of issues. All formatting codes (this applies to the <green>, the <tooltip>, and the &2) format the messages inappropriately; as far as I can tell, they not only apply forwards in the text until they find another color code or a reset, but backwards as well. There are no color codes in the message until after the "Part One" text, yet it is receiving the green color from the <green> tag, which it shouldn't. The tooltip, which is surrounding "Part 3", is also appearing when "Part 2" is hovered over, yet not for "Part 1" (likely because the <green> code is creating a new chat message section, which breaks it off there). This is how it should look.

Additionally, the default Bukkit behavior of color codes resetting style codes no longer works (by style codes I refer to underline, bold, obfuscation, and italics). This is not how it has always worked; previously, the underline would have stopped at the &6 in that message, yet now it continues through. The behavior still works as intended elsewhere in Skript (such as item names), but is now inconsistent throughout the plugin since it works differently for chat messages (you can see the appropriate version appearing over my hotbar for the renamed item).

Setup

  • Spigot-d276ab1-1f6c04c for 1.11.2 (1 version behind latest)
  • Skript dev26c
  • No addons, no scripts loaded
  • Setup screenshot
@TheBentoBox TheBentoBox added the bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. label Apr 10, 2017
@TheBentoBox TheBentoBox changed the title Color codes not colorizing parts of text correctly Formatting codes not applying to correct sections of text Apr 10, 2017
This was referenced Apr 10, 2017
@bensku
Copy link
Member

bensku commented Apr 11, 2017

Formatting codes now apply to correct sections. However, I have decided that color codes will, in future, not reset other formatting. I will try to make it consistent so it works this way everywhere, but sadly not in this release - out of scope for bugfix.

@bensku bensku closed this as completed Apr 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue that needs to be fixed. Alternatively, a PR fixing an issue.
Projects
None yet
Development

No branches or pull requests

2 participants