XHTMLJS: New Javascript XHTML editor

by Jon Davis 15. March 2008 17:49

I just pushed a v0.2 of the DOM-to-XHTML conversion script.

  • New real-time XHTML editor! -- Type bad HTML into one textbox, see good XHTML come out the other textbox
    • I needed this so that I can test the XHTMLization with arbitrary markup, but the net result is a really handy tidy page that anyone an use without writing Javascript code
  • Moved the function declarations to an object variable at window.xhtmljs
  • Fixed an "[object]" output bug where there is no text and no HTML tag name
  • Extended jQuery using .fn. rather than .prototype.


In the next round of tweaks I'll clean the formatting logic as there are some indentation errors. Awfully handy, somehow I overlooked it.

Update: Ugh, a few more failures beyond indentation, namely some XHTML-accepted tags (like <input>) and attributes (like onxxxx event handlers) are still going missing in strict mode. The Editor should allow for the de-toggling of strict mode, and IMO I think enabling strict mode for the jQuery extension was a mistake. Also, plain-text ">" (&gt; in markup) is not outputting as "&gt;" but as ">".

kick it on DotNetKicks.com

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , ,

Web Development


Add comment

(Will show your Gravatar icon)  

  Country flag

  • Comment
  • Preview


Powered by BlogEngine.NET
Theme by Mads Kristensen

About the author

Jon Davis (aka "stimpy77") has been a programmer, developer, and consultant for web and Windows software solutions professionally since 1997, with experience ranging from OS and hardware support to DHTML programming to IIS/ASP web apps to Java network programming to Visual Basic applications to C# desktop apps.
Software in all forms is also his sole hobby, whether playing PC games or tinkering with programming them. "I was playing Defender on the Commodore 64," he reminisces, "when I decided at the age of 12 or so that I want to be a computer programmer when I grow up."

Jon was previously employed as a senior .NET developer at a very well-known Internet services company whom you're more likely than not to have directly done business with. However, this blog and all of jondavis.net have no affiliation with, and are not representative of, his former employer in any way.

Contact Me 

Tag cloud


<<  May 2021  >>

View posts in large calendar