-
Notifications
You must be signed in to change notification settings - Fork 72
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
Usage of .Text() in custom builder always gets overridden #99
Comments
Do you have a larger example? What does your registration code look like? |
Provided as pull request. I guess the test can't be more to the point (and for this issue I don't see any use for additional configuration), but the code is part of mycroes/SupportManager (...Conventions.cs). |
Well actually, the issue is part of SupportManager, where I use a builder to properly format DateTime(Offset)s, the code is just a contrived test. |
Finally coming back to this. This is because the ModelMetadata extensions (that make these behave like ASP.NET Core) are modifiers, not builders. Builders go first, then modifiers. You've replaced the builder, not the modifier. Adding your modifier makes this work: reg.Displays.IfPropertyIs<DateTimeOffset>().ModifyWith(m => m.CurrentTag.Text("date-time-builder")) |
This is related to #95 (and a regression since HtmlTags 6.x). When creating a custom builder as following:
the test below fails:
I'd love to know if you intend to fix this or if you'll accept this as expected behavior (I guess a modifier can still be used to override the text).
The text was updated successfully, but these errors were encountered: