WYSIWYG

It’s Friday, and that means it’s time for the third project in my open source fortnight. This one is a simple WYSIWYG text style editor that uses contenteditable for its rendering.

WYSIWYG

The library allows you to apply basic styles, such as bold and italic to a contenteditable HTML element. You can then read the HTML straight from that element. It’s written in CoffeeScript in a MVC ‘controller’ style and its only dependency is jQuery.

Content editable is a fickle beast, with an archaic API and poorly documented functionality. However in modern browsers, it does produce good HTML and is certainly a viable WYSIWYG solution.

I find the secret to creating WYSIWYGs (or software in general for that matter), is to keep things as simple as possible. That said, this library could certainly improve in a number of areas. For example:

  1. Have a way of overriding the alert() notices
  2. Show selected styles (this may be harder to do than I first anticipated)
  3. Cross-browser keyboard shortcuts

In the spirit of open source fortnight I’m releasing it to the community. I’m excited to see where it goes next.

 
218
Kudos
 
218
Kudos

Read this next

When you should quit your job

I have a simple rule for quitting jobs, and it has served me pretty well in the past. You should quit your job when you stop loving your job. Sounds straightforward, but how do you define that? Well, I believe the definition of whether... Continue →