htmlArea

A directory of browser-based WYSIWYG editors

  MAIN
INDEX
SEARCH
POSTS
WHO'S
ONLINE
LOG
IN

Home: htmlArea 3 (beta): htmlArea 2 & 3 archive (read only): htmlArea v3.0 - Discussion:
Keeping background color in wordClean


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.

 


simontux
New User

Jan 6, 2005, 2:00 AM

Post #1 of 3 (2675 views)
Shortcut
Keeping background color in wordClean Can't Post

Hi everyone,

Need a little bit of help here. I want to keep the style for background:color when I use wordClean function. But I want it to clean out all the other stuff as per normal.

Thanks for you help.
Simon.


simontux
New User

Jan 6, 2005, 10:18 PM

Post #2 of 3 (2660 views)
Shortcut
Re: [simontux] Keeping background color in wordClean [In reply to] Can't Post

Got it sorted... managed to hack my way through it..... if your interested here is the code that I came up with.



Code
if ((wordData.indexOf('class=Mso')>=0) | (wordData.indexOf('class="Mso')>=0)){  
.........
wordData = wordData.replace(/[^\s]*BACKGROUND: ([a-z#0-9]*)[^\;|^\s]*\;/gi,'bgcolor=$1');
.........
}



simontux
New User

Jan 6, 2005, 10:25 PM

Post #3 of 3 (2658 views)
Shortcut
Re: [simontux] Keeping background color in wordClean [In reply to] Can't Post

PS. That code will only work in IE

 
 
 


Search for (options)