Does anyone have UE scripts that can do these?
Thanks!
Thanks!
Code: Select all
UltraEdit.selectClipboard(0);
// Remove xml blocks.
var sWordData = UltraEdit.clipboardContent.replace(/<xml.*?>[\S\s]+?<\/xml>/g,"");
// Remove style blocks.
sWordData = sWordData.replace(/<style.*?>[\S\s]+?<\/style>/g,"");
// Remove conditional comment blocks.
sWordData = sWordData.replace(/<!--\[if.*?>[\S\s]*?<!\[endif\]-->/g,"");
// Remove all tags.
sWordData = sWordData.replace(/<[!\/A-Za-z][^>]+?>/g,"");
// Replace all non breaking spaces by normal spaces.
sWordData = sWordData.replace(/ /g," ");
// Replace all horizontal tabs by normal spaces.
sWordData = sWordData.replace(/\t/g," ");
// Remove all spaces at end of a line.
sWordData = sWordData.replace(/ +\r\n/g,"\r\n");
// Replace a sequence of spaces by a single space.
sWordData = sWordData.replace(/ +/g," ");
// Remove a single space at beginning of a line.
sWordData = sWordData.replace(/\n /g,"\n");
// Replace multiple blank lines by a single blank line.
UltraEdit.clipboardContent = sWordData.replace(/(?:\r\n){3,}/g,"\r\n\r\n");