Mark Greenwood Team : Web Development Tags : Programming

How to display HTML entities

Mark Greenwood Team : Web Development Tags : Programming

Representing HTML tags in a WYSIWYG editor so that your readers can see the HTML tag can be tricky.

WYSIWYG editors are pretty average and have a way of confusing things, especially where they see HTML.

There are (at least) three ways to display HTML entites:

Using greater than as an example:

  1. The actual character >
  2. The name >
  3. The hex number >

 

Using 1. presents obvious problems.

Normally using 2. is the solution, though for whatever reason, that also sometimes doesn't work.

So try using technique 3. You can also put a space between the "tag" and the lt / gt so that there is no confusion in your WYSIWYG editor.

Have a look at this resource for more.