Web www.gerd-tentler.de

Version 1.0 (released Jan. 4, 2010)

Introduction

Use this script to convert your HTML textareas into a code editor with realtime syntax hilighting. You can create as many editors as you want within your HTML page. When put into a form, the contents can be submitted, e.g. to be written to a file.

Generally, code editing should work on Windows with Internet Explorer 5.5+ and with browsers using the Mozilla 1.3+ engine, i.e. all browsers that support "designMode".

This script was tested with the following systems and browsers:

 Windows XP/Vista:    IE 8     Opera 9     FF 3    

If you use another browser or operating system, this script may not work for you - sorry.

NOTE: The script also works with browsers that don't support code editing - a simple textarea will replace the code editor.

List of supported languages

Currently the code editor supports the following languages:
  • JavaScript
  • PHP
  • HTML
  • CSS

Known issues

This is a list of things that don't work at the moment. If somebody knows a solution, please tell me! ;-)
  • The tab key does not work correctly with Opera browsers.
  • Tabs are converted into 4   entities when the code is "loaded", and 4   entities will be converted into a single tab character when the code is "saved". Please note that this is just a workaround, since there is no HTML entity for tabs (as far as I know) that works in the browser's design mode.
  • Browsers that use the WebKit engine (e.g. Google Chrome) are not supported at the moment. If you want to test it, just modify line 62.

JavaScript example


PHP example