Without a whole bunch of trickery (parsing a tags body yourself or creating a TagHelper
that targets everything) you can't do this 100% today (beta6).
You can partially fix your issue by ensuring <inputField>
elements only appear inside of a <blockSection>
tag (would not restrict you from putting things like <p>
inside of a <blockSection>
). Can be accomplished by using context.Items
bag to notify an InputFieldTagHelper
that it's (or is not) encapsulated by a <blockSection>
. See this issue for information on how to communicate between child => parent.
If you're willing to wait for this Razor issue to be completed; you'll be able to enforce what tags can appear inside your TagHelper
.
Another similar SO issue for reference.