wiki:UtilJs

util.js

This file defines useful variables and functions called by other files.

Variables

  • var entities, var numEntities : Arrays used to convert html entities to numeric entities.

String functions

  • function sTrim(sText)
  • function lTrim(sText)
  • function rTrim(sText)
  • function insertAt(sText,sInserted,iPos)

Array manipulation functions

  • function indexOfArray(ar,item)

Cleanup functions

  • function cleanupHTML(sHtml) : This a rather complex function which cleans up generated html end is called before submission.

Note: be aware that currently there is no javascript-based HTML editor which can garantee a 100% (X)HTML valid code.
If you want perfectly clean and conform (X)HTML code, you need to use also a server-based cleaning solution like Tidy.