Karl Swedberg wrote:

Internally, jQuery determines whether to use document.createElement by checking the string against a regular expression:

    rsingleTag = /^<(\w+)\s*\/?>$/

Unless I'm missing something, allowing for both syntaxes would be trivial. Just change the regex to something like this (untested):

    rsingleTag = /^<(\w+)\s*\/?>(<\/\w+>)?$/

I think I'll recommend that.

That seems to work.

But event then, in the following case '<span/>' is still being
converted to '<span></span>' (and then passed to innerHTML):

  var html = '<span/>';
  $("#div").html(html);

--
Bertilo Wennergren <http://bertilow.com>

Reply via email to