htmlArea

A directory of browser-based WYSIWYG editors

  MAIN
INDEX
SEARCH
POSTS
WHO'S
ONLINE
LOG
IN

Home: htmlArea 2: htmlArea 2 & 3 archive (read only): htmlArea v2.0:
Great tool! Have some modification questions.


The htmlArea 2 & 3 editors have been discontinued.

We've made these forums available as a read-only reference and knowledge-base for people using or developing editors based on htmlArea 2 or 3.

Anyone who is interested in taking over version 2 or 3 is free to do so. All we ask is that you choose a new name that doesn't have "htmlarea" in it to avoid confusion with this site. We'll even give you a link in the directory to make it easier for people to find you. If you are developing or hosting an htmlArea based-editor under a new name, please submit it to our directory.

 


m00n
New User

Dec 7, 2004, 11:19 PM

Post #1 of 7 (2628 views)
Shortcut
Great tool! Have some modification questions. Can't Post

Hey all... First off I wanna say this is a great tool.

Here is my problem. We are taking this HTML and shoving it into a database. From the database, this HTML gets mixed in with some XML. The XML contains data to display on the page, yet at the same time, this HTML needs to render correctly on the page...

One of the requirements we have is that the HTML needs to be properly formed HTML. I.E... <BR> tags need to be closed as in </BR> and list item tags need to be closed as well.

We are using another utitliy class that takes the output of this and tries to ensure that it is well formed HTML. However, because this utility does not close close things like the <LI> tag we end up with nested lists... Example

This tool will produce this

<UL>
<LI>One
<LI>Two
<LI>Three
</UL>

Once we run it through our validator, we end up with this.
<UL>
<LI>One
<LI>Two
<LI>Three</LI></LI></LI>
</UL>

Also anohther delima we are having is that the utilty is not inserting quotes around hex values... Such as color. I seen some other posts about this here on this board, but a solution was not posted rather, the gentlemen kindly offered to make the modifications for the person asking for help.

I would sure appreciate any help I can get from you guys in how we can force this control to close all HTML tags and enforce properly formed HTML.

Thanks so much!Smile


jonnyl
Novice

Dec 8, 2004, 11:38 AM

Post #2 of 7 (2602 views)
Shortcut
Re: [m00n] Great tool! Have some modification questions. [In reply to] Can't Post

I won't claim to be an XML expert which I am certainly not but I know that it is possible to use CDATA to make the xml-parser ignore snippets.

For example:


Code
  <?xml version="1.0" encoding="ISO-8859-1" ?>   
<content>
<html>
<![CDATA[ Imagine horribly malformed HTML here! ]]>
</html>
</content>


Everything in the CDATA is ignored by the parser, hence you could write something incredibly malformed there.

Otherwise you might consider using a server side parser for the htmlArea output. Search and replace <br> to <br/>, <li>xxxx to <li>xxxx</li> and so on and so forth. Maybe someone has already done one in your script language. Not very har do make one though. What script language are you using?


m00n
New User

Dec 8, 2004, 12:12 PM

Post #3 of 7 (2594 views)
Shortcut
Re: [jonnyl] Great tool! Have some modification questions. [In reply to] Can't Post

We are using ASP.NET and C#. The control sits on one of the ASP.NET pages. We are sending the data through a parser, but it's that parser which is missplacing closing tags.


m00n
New User

Dec 8, 2004, 1:40 PM

Post #4 of 7 (2591 views)
Shortcut
Re: [m00n] Great tool! Have some modification questions. [In reply to] Can't Post

I did some more testing on this... It's odd. If i create a bullited list, do a view source, the source is fine. If i then click back to wisiwig view, then go BACk into view source mode, the closing tags are then gone... Is htmlArea stripping them off or is it the core MSHTML functionality thats doing this?


jonnyl
Novice

Dec 8, 2004, 3:06 PM

Post #5 of 7 (2588 views)
Shortcut
Re: [m00n] Great tool! Have some modification questions. [In reply to] Can't Post

You're right. Same thing happens to me. Haven't noticed before. Bummer. No idea weather it's htmlArea or MS that screws things up.

Anyhoo, I'm not a .NET guy so I don't know weather you're using a native parser or something you've written yourself. In any case it sounds like it needs a bugfix.

However. I found this: http://www.html2xhtml.richarea.com

html2xhtml ... sounds good eh? However you have to pay to use it in a commercial product so in my case I'll keep looking or do it myself, since my CMS is commercial.


(This post was edited by jonnyl on Dec 8, 2004, 3:14 PM)


m00n
New User

Dec 8, 2004, 4:33 PM

Post #6 of 7 (2579 views)
Shortcut
Re: [jonnyl] Great tool! Have some modification questions. [In reply to] Can't Post

it's a nice too as well, but if you try it, it will do teh exact same thing... it strips off closing </LI> tags. This leads me to believe it must be a MSHTML issue.


jonnyl
Novice

Dec 8, 2004, 5:28 PM

Post #7 of 7 (2577 views)
Shortcut
Re: [m00n] Great tool! Have some modification questions. [In reply to] Can't Post

I found a potential solution here on the forum. In editor.js I added the following in the function editor_filterOutput(objname).

Under the comment //add additional tag filtering here


Code
 if (tagName == 'br') { 
tagBody = "<br/>";
}





This at least takes care of the problem with the <br> tag. It's an onSubmit event though so it will not be visible within htmlArea but at least you won't have to deal with it on the server side. I won't write a fix for the bulletlists tonight. It's already 12.30 pm here in sweden and it's a school nite. Cool If anyone beats me to it, please post!


 
 
 


Search for (options)