HTML Entities, Django and Editing HTML within a TextArea Field

Within TextArea fields, Browsers auto render & display certain "HTML Entities" and "HTML Entity Codes" as characters. Browsers also auto change any "HTML Entity Codes" entered into a TextArea field into the resultant display characters before uploading. There's no way to change this, making it difficult to edit html in a TextArea field.

Therefore, when editing Django templates in the CMS, we have to render the HTML Entity Code equivalents within the TextArea tags at the code level, which are then displayed as the raw characters when shown in a TextArea. We accomplish this by using the "escape" filter, which is a standard filter in the Django template toolbox.

You make your edits in the TextArea using standard HTML, and then upon submitting the content, that which is displayed in the TextArea itself at the display level, and not the content that appears within the TextArea tags at the code level, is sent to the server for storage.

0 Comments, 0 trackbacks (Trackback URL)

0 responses to HTML Entities, Django and Editing HTML within a TextArea Field

Leave a Comment
  1. (required)
  2. Ignore this field:
  3. Don't put anything in this field:
    Don't put anything here:
  4. Leave this empty:
    (required)
  5. Your email is not publically displayed.