We've built an HTML editor into our web-based application (it's the DHTML /
javascript thing that many people are using nowadays). Anyway, I've noticed
that when I copy text from a MS Word document and paste it into the editor
window, all the XML / CSS / Whatever tags that Word uses get copied over
too. The problem with this is:
1. Our editor has no way of creating, editing, or deleting any XML or CSS...
only <font> (we have a "Remove Formatting" function, but it only works for
<font> tags... it won't even touch CSS)
2. Therefore, we've had a LOT of trouble editing the formatting (bold,
italic, font, etc) of text that's been copied from Word. This is because the
Word tags are competing with the <font> tags... sometimes the Word tags take
control, sometimes the <font> tags win out.
This is obviously a HUGE problem for an alleged WYSIWYG system because WYS
is not always WYG. The makeshift solution we've come up with for the time
being is simply to NOT use Word (use a plain-text editor instead), which
really isn't a viable solution at all, since most of the known business
universe uses Word.
Has anyone run into this and come up with a solution? Many thanks :)
--
-------------------
Brian P Donohue
Thumbprint Interactive (TM)
www.thumbprintweb.com
--- code ---
/* clean up word content */
// remove all class and style attributes
for (var intLoop = 0; intLoop < workspace.all.length; intLoop++) {
el = workspace.all[intLoop];
el.removeAttribute("className","",0);
el.removeAttribute("style","",0);
}
// remove all xml prefixes and smarttags
var html = workspace.innerHTML;
html = html.replace(/<o:[pP]> <\/o:[pP]>/g, ""); // Remove all
instances of <o:p></o:p>
html = html.replace(/o:/g, ""); // delete all o: prefixes
html = html.replace(/<st1:.*?>/g, ""); // delete all smarttags
html = html.replace(/<[pP]><\/[pP]>/g, ""); // delete all empty
paragraph tags
html = html.replace(/<[pP]> <\/[pP]>/g, ""); // delete all empty
paragraph tags
--- code ---
"BPD" <don...@paonline.com> wrote in message
news:#vzTueIRCHA.1440@tkmsftngp11...
http://office.microsoft.com/downloads/2000/Msohtmf2.aspx
Regards
Alejandro.
--
Ce message a ete poste via la plateforme Web club-Internet.fr
This message has been posted by the Web platform club-Internet.fr
Steffest
On 19 Aug 2002 07:48:09 GMT, Alejandro Jimenez <acho...@yahoo.es>
wrote:
--
-----------------------------------
David Fetrow
HelixPoint LLC.
da...@helixpoint.com
717-732-4335
-----------------------------------
"Alejandro Jimenez" <acho...@yahoo.es> wrote in message
news:2002819-8...@foorum.com...
We've been telling people to save their Word docs as Text only, then paste
from the .txt file to the HTML editor. This method DOES work, but it's a
real pain in the butt... not a very user-friendly work around.
We've also found another, related bug... this time in the HTML editor
itself. It will not let you make your text Arial!!! The text is Arial by
default, but I cannot assign the Arial font to selected text. In code view,
no font tags appear... although all other fonts work fine.
Anyone had this problem?
Thx again...
---------------------------
Step1:
In your editor: add a new function called "Import Word file..."
Step2:
- Code a function in which you create a FileOpen dialog en thus letting the
user to point to a Word file.
- Let TIDY process this inputstream en when finished let tidy output the
stripped code to the editor.
I'm sorry I haven't got an example, but I have programmed this before. It
works!
More info: http://www.w3.org/People/Raggett/tidy/
Download: http://tidy.sourceforge.net/
Good Luck, Corjan
"steffest" <stef...@hotmail.com> wrote in message
news:s5t3mu4i1q68m2j8k...@4ax.com...