I can’t think of anything right off the bat, but I think you could write an extension method that allows you to add a parameter / list of elements that can be resolved.
Html.Encode(Mode.fieldName, List<items> Myitems);
It can modify valid tags in <, etc., and then encodes the rest, as usual.
source
share