| Page 1 of 3 | [ 21 posts ] | Go to page 1, 2, 3 Next |
Karen
|
I was searching trying to find a way for YUI RTE to remove MS word code as well as clean up the html so it does’nt throw an error in my RSS feed and I found this post made in 08 http://old.nabble.com/Re%3A-Table-in-YUI-Rich-Text-Editor-p20803667.html
@rtfully, Karen lee
Is there an example of how to implement this in the latest yui rte version? or is there another way to strip MS word invalid code, or to set the exact characters you want removed? |
|
Try setting the filterWord config option:
http://developer.yahoo.com/yui/docs/YAH ... ter_msword Code: filterWord: true |
Karen
|
Hi Dav
(I posted this on your site, so need to answer it there now). I did put the filterWord option in but it does'nt take out all the ms code, is there somewhere I can make it take out other tags, like inline styles? I have my php script stripping them but that does'nt happen till after it's posted which causes an error initially on the finish screen, so I need to strip them out before post as well. I tried the CleanPaste hack from antscode blog but the insert image function is putting a width=_foo height=_foo (underscore before the pixel number and no qoutes) on the image tag which is invalid so cleanpaste removes the image. Also, the insert link tool when selecting open in new window option is putting the link as target=_blank, rather than target="_blank" (with the quotations) so that causes the xml rss feed file to throw an error, is there somewhere I can change the way these tags are output? |
|
The Word filter is a "general" filter, since Word puts so much garbage in it's hard to filter it all out without some valid cases.
For now you can override the filter_msword method to make it filter anything extra you want removed. Once you have it working better, file an enhancement request, give me a test case and the code. I would be happy to roll it into a future release. |
Karen
|
thx Dav, unfortunately, I have no idea how to override the filter_msword could you give me an example?
|
|
Include this JS after the main editor file, but before you instantiate your instances:
ExampleClick here to see the revision history on this Gist. |
Karen
|
thx so much, makes sense now. I'll give it a go.
|
Karen
|
Well, I made a custom js file with your suggestions, put it just below the main editor file but above my instances, I put filterWord: true in my config, it's not throwing an error but the word tags are'nt being replaced, nothings happening. Maybe I'm missing something above the myEditor.saveHTML(); ??
|
|
You need to post a link.
|
Karen
|
removed url
@rtfully, Karen lee
Last edited by lilycreek on Tue Nov 10, 2009 9:47 am, edited 1 time in total. |
| Page 1 of 3 | [ 21 posts ] | Go to page 1, 2, 3 Next |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group