Give HTMLHelper clear way to to include tag content as HTML or as plain text

Description

Many of the tags created by the HTMLHElper allow for user input that is nested as inner HTML to that tag. The helper currently assumes it is HTML as opposed to plain text. If a dev wants the text to be taken as plan text, they have to escape HTML manually. This requirement is not immediately obvious nor convenient.

I would recommend we follow the lead of libraries such as jQuery and provide two clear methods to users to append content that is HTML or plain text

Perhaps we keep "content" and add "textcontent" as well? Ideally I'd like to deprecate "content" as it's too generic and rename it to "html" and "text" to match jQuery.

Here is a list of functions that can output nested HTML inside the current tag. Each of these can be called with either HTML or plain text. We need to come up with a consistent approach to make it clear if the input will be considered HTML or plain text (escaped with HTMLEditFormat())

  • href - The 'text" attribute

  • anchor - The 'text" attribute

  • heading - The "title" parameter

  • startFieldSet - The "legend" parameter

  • label - The "content" parameter

  • tag - The "content" parameter

  • button - The "value" parameter

  • arrayToTable - The "data" parameter. Both th and td tags

  • toHTMLList - The "values" parameter

Assignee

Luis Majano

Reporter

Brad Wood

Labels

None

Components

Priority

Major
Configure