| Page 1 of 1 | [ 4 posts ] |
MarcYUI Contributor
|
Hi,
I'm having problems with the Wysiwyg editor. When I start typing text and press ENTER, the source shows DIVs being placed around the paragraph. However, on submit these divs are not replaced by BRs and are therefore filtered out on our server. Any ideas what is wrong here? Code: Y.all('form textarea.wysiwyg').each(function(node,idx,ctxt){ var editor = new Y.EditorBase({ content: node.get("value") }); editor.plug(Y.Plugin.EditorBidi); editor.plug(Y.Plugin.EditorBR); node.wrap("<div/>"); node.ancestor("div").addClass("wysiwyg-editor"); node.ancestor("div").insertBefore("<div></div>"); node.get("form").on("submit",function(){ node.set("value",editor.getContent()); }); editor.render(node.ancestor("div").one("div")); }); |
|
EditorBR does not filter out the DIV's that the brower creates. It attempts to put them in for you. But if you are also plugging the BiDi plugin, you are side stepping the BR plugin since EditorPara is required to have EditorBidi work.
Remove EditorBidi and EditorBR should work as expected. |
MarcYUI Contributor
|
Thx!
|
MarcYUI Contributor
|
I still see problems after removing bidi
This is what I seen after a text like this Code: Testterrgdf gdg ddg dg fdg dg df gfdg fdg fdg ddf fd fdg dfg fdg gd d dggd dgdfgdfgfdgfd gdgdfgfdg dfgdgfdgfdg dfgdgfdgfdgdgdg Code: Testterrgdf gdg ddg dg fdg dg df gfdg fdg fdg ddf fd fdg dfg fdg gd d dggd <div><br></div> <div>dgdfgdfgfdgfd</div> <div>gdgdfgfdg</div> <div><br></div> <div>dfgdgfdgfdg</div> <div><br></div> <div><br></div> <div>dfgdgfdgfdgdgdg</div> I see two things: 1. I need to do two enters to retain one enter 2. The BRs are placed in a funny way with the DIV around them This is my wysiwyg code (3.4.1): Code: Y.all('form textarea.wysiwyg').each(function(node,idx,ctxt){ var editor = new Y.EditorBase({ content: node.get("value") }); editor.plug(Y.Plugin.EditorBR); node.wrap("<div/>"); node.ancestor("div").addClass("wysiwyg-editor"); node.ancestor("div").insertBefore("<div></div>"); node.get("form").on("submit",function(){ node.set("value",editor.getContent()); }); editor.render(node.ancestor("div").one("div")); }); Cheers, Marc |
| Page 1 of 1 | [ 4 posts ] |
| 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