The UK Home Automation Archive

Archive Home
Group Home
Search Archive


Advanced Search

The UKHA-ARCHIVE IS CEASING OPERATIONS 31 DEC 2024


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

OT: Javascript Reg's -> ASP.NET to clean MSWord HTML


  • To: ukha_d@xxxxxxx
  • Subject: OT: Javascript Reg's -> ASP.NET to clean MSWord HTML
  • From: "Chris Bond" <chris@xxxxxxx>
  • Date: Wed, 28 Jan 2004 16:05:29 -0000
  • Mailing-list: list ukha_d@yahoogroups.com; contact ukha_d-owner@xxxxxxx
  • Reply-to: ukha_d@xxxxxxx

Right very werid problem trying to cleanup some msword html server
side.  I've found a javascript routinue below but converting it to
asp.net to remove the msword html formating just doenst seem to work.

Tried a number of varients of the ASP.NET syntax but it doesnt do
sod all (im writing in vb.net not c#).

Anybody any ideas?

function cleanWord()
{
var textHtml = radEditor.innerHTML;
textHtml = textHtml.replace(/<\?xml[^>]*>/ig, "");
textHtml = textHtml.replace(/<\/?[a-z]+:[^>]*>/ig, "");
textHtml = textHtml.replace(new RegExp("(<[^>]+) class=[^^>]
*([^>]*>)", "ig"), "$1 $2");
textHtml = textHtml.replace(/(<[^>]+) style="[^"]
*"([^>*>)/ig, "$1 $2");
textHtml = textHtml.replace(/<span[^>]*><\/span[^>*>/ig,
"");
textHtml = textHtml.replace(/<span[^>]*><\/span[^>*>/ig,
"");
textHtml = textHtml.replace(/<span><span>/ig,
"<span>");
textHtml = textHtml.replace(/<\/span><\/span>/ig,
"</span>");
radEditor.innerHTML = textHtml;
}


UK Home Automation Meet 2004 - BOOK NOW!
http://www.ukha2004.com

http://www.automatedhome.co.uk
Post message: ukha_d@yahoogroups.com
Subscribe:  ukha_d-subscribe@yahoogroups.com
Unsubscribe:  ukha_d-unsubscribe@yahoogroups.com
List owner:  ukha_d-owner@yahoogroups.com


Home | Main Index | Thread Index

Comments to the Webmaster are always welcomed, please use this contact form . Note that as this site is a mailing list archive, the Webmaster has no control over the contents of the messages. Comments about message content should be directed to the relevant mailing list.