We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Following unit test will fail:
@Test void testNumberStuff() { final String input = "<test:'bla'> is a nice number"; final Component expected = text("bla is a nice number"); this.assertParsedEquals( expected, input, TagResolver.resolver("test", (argumentQueue, context) -> { if (argumentQueue.hasNext()) argumentQueue.pop(); return Tag.preProcessParsed("bla"); }) ); }
The Tag.preProcessParsed doesn't allow arguments. It will just remove the tag and doesn't insert the text.
I debugged MiniMessage and I was able to find: https://github.com/KyoriPowered/adventure/blob/9403962bb1afbd3392b580654f68403dcd426f6a/text-minimessage/src/main/java/net/kyori/adventure/text/minimessage/internal/parser/match/StringResolvingMatchedTokenConsumer.java String tag is "test:'bla', therefore TagInternals.sanitizeAndCheckValidTagName(tag) doesn't accept the tag as a valid tag and doesn't insert anything.
String tag
"test:'bla'
TagInternals.sanitizeAndCheckValidTagName(tag)
The arguments should be parsed and passed to the tagProvider.resolve call instead.
tagProvider.resolve
The text was updated successfully, but these errors were encountered:
Related to the sanitizing in StringResolvingMatchedTokenConsumer#L71 and following:
final String cleanup = this.input.substring(start + 1, end - 1); final String tag = cleanup.substring(0, cleanup.indexOf(":"));
inserting this resolves the issue partially. Then the tag will be resolved fine but no arg will be passed.
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Following unit test will fail:
The Tag.preProcessParsed doesn't allow arguments. It will just remove the tag and doesn't insert the text.
I debugged MiniMessage and I was able to find:
https://github.com/KyoriPowered/adventure/blob/9403962bb1afbd3392b580654f68403dcd426f6a/text-minimessage/src/main/java/net/kyori/adventure/text/minimessage/internal/parser/match/StringResolvingMatchedTokenConsumer.java
String tag
is"test:'bla'
, thereforeTagInternals.sanitizeAndCheckValidTagName(tag)
doesn't accept the tag as a valid tag and doesn't insert anything.The arguments should be parsed and passed to the
tagProvider.resolve
call instead.The text was updated successfully, but these errors were encountered: