Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

#1 2005-05-11 09:06:00

troels_kn
New member
Registered: 2005-05-11
Posts: 1

getHTML suggestion

Hi

I have been developing a plugin for htmlarea, and I'm considering to port it to Xinha, since the development of htmlarea has stalled.
While working with this plugin I also had to do a few patches/hacks on htmlarea and thus I pretty much knows the insides of htmlarea. I don't really have the time currently to opt in on developing on xinha, but I have a few suggestions for improvements.
For one thing, I had to pull out xhtml-wellformed content in a more effecient way. Using javascript to traverse through the dom and build the markup is quite cpu-hungry. The solution I came up with was to use an arsenal of regex'es to correct the html output into xhtml. The speed-improvement is considerable (more than 1:1000). I also made a function for correcting idention of sourcecode. Theese functions could quite easily be integrated into xinha, by substituting HTMLArea.getHTML() / HTMLArea.getHTMLWrapper()

The source in mind can be found by downloading the Indite plugin - You should use the file xml/XML_Utility.js and the functions XML_Utility.cleanHTML() and XML_Utility.indent(), witch takes the "raw" markup from editor.getInnerHTML(). Works with mozilla and IE.

Another thing I encountered was the need to hook up to htmlarea onsubmit event from the plugin. Since there is no way to do this, I had to apply an ugly hack in the plugin. A much better way would be to make it possible for plugins to register for an onsubmit event somehow. Shouldn't be hard to implement really.

Offline

Board footer

Powered by FluxBB