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

Add Context#preProcess to resolve all preProcess tags #760

Open
wants to merge 2 commits into
base: main/4
Choose a base branch
from

Conversation

Joo200
Copy link
Contributor

@Joo200 Joo200 commented Apr 30, 2022

This PR adds a new method to Context. With this method you can resolve preProcess tags in your own TagResolver.

This should be handy for TagResolvers which do not directly insert components and want to have some sort of recursive resolvers.

I added a recursion limit to throw an exception once the TagResolvers tried 10 times to preProcess those tags.

This will add a new method to context to allow TagResolvers to replace PreProcess tags with the String value.
It has a recursion limit to deny stack overflows from recursions
@zml2008
Copy link
Member

zml2008 commented May 15, 2022

I'm sort of reluctant to expand the API around pre-process tags -- it's one more thing to deprecate if we end up finding a better alternative to those tags.

The alternative currently would be deserializing a string as a Component and then serializing it using the plain text serializer, which would have the bonus of supporting all tag types. Thoughts?

@zml2008 zml2008 added the status: needs discussion An issue or PR that requires design decisions or further consensus building before it can be merged label Nov 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: text-minimessage status: needs discussion An issue or PR that requires design decisions or further consensus building before it can be merged type: enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants