XHTMLJS: New Javascript XHTML editor

by Jon 3/15/2008 5:49:00 PM

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.

http://cachefile.net/scripts/xhtmljs/

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

Related posts

Comments

3/17/2008 8:06:15 PM

BTM

Handy little thing you've got there - but I've got a question - why are there two empty DIV's in the table in the example screenshot?

BTM pl

3/17/2008 8:27:43 PM

Jon Davis

Internet Explorer apparently auto-inserts that if you don't close your <TD>.

Jon Davis us

Add comment


(Will show your Gravatar icon)  

  Country flag





Live preview

11/21/2008 5:11:40 AM


 

Powered by BlogEngine.NET 1.2.0.0
Theme by Mads Kristensen

About the author

Jon Davis 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 is currently in a temp-to-perm contract with a media corporation that primarily produces B2B magazines. The insanely complete and powerful Content Management System that they are switching to is SiteCore CMS, which is arguably the richest and most complete ASP.NET 3.5 based CMS on the planet.
E-mail me Send mail

Most Recent of Many Library Investments

Calendar

<<  November 2008  >>
MoTuWeThFrSaSu
272829303112
346789
10111213141516
17181920212223
24252627282930
1234567

View posts in large calendar

Pages

    Recent comments

    Authors

    Tags

    Disclaimer

    The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

    © Copyright 2008

    Sign in