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

Replacements are broken by colour code gradients. #13

Closed
Xemorr opened this issue May 19, 2021 · 4 comments
Closed

Replacements are broken by colour code gradients. #13

Xemorr opened this issue May 19, 2021 · 4 comments

Comments

@Xemorr
Copy link

Xemorr commented May 19, 2021

Used Version

1.7.0-SNAPSHOT

Environment description

Windows 10
Java 11

What is happening?

"&e&lClass &8&l»&#ff0-#fff& %gifter% &7has blessed you with extra hearts!"
The %gifter% isn't replaced when there is a gradient across it.

What did you expect to happen?

I expected the %gifter% to be replaced by whatever I specify in my program

Additional context

@Phoenix616
Copy link
Owner

You will have to use the replaceFirst option on the MineDown class in order for replacements to be applied before parsing. Afterwards it will not work and most likely never will as it would be impossible to apply gradients first and the replace placeholders without the gradient "desyncing".

Unfortunately changing the default behaviour of the parse utility method now is also out of the question as plugins will rely on it being replaced after the formatting was applied, not before.

@Xemorr
Copy link
Author

Xemorr commented May 19, 2021

Is there a way you can change it to replaceFirst(true) by default in your own plugin?

@Xemorr Xemorr closed this as completed May 19, 2021
@Xemorr Xemorr reopened this May 19, 2021
@Phoenix616
Copy link
Owner

Currently not, no. But providing some way to do that (e.g. via a system property) would be an interesting solution for this.

@Xemorr
Copy link
Author

Xemorr commented May 19, 2021

Okay, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants