Forum closed. New forum available at http://community.wymeditor.org/

insert new container after preformatted section (code)

Support forum for WYMeditor.

insert new container after preformatted section (code)

Postby furtivefelon on Mon Oct 19, 2009 7:57 am

Hi all,

If i change a paragraph container to a preformatted container, if i press enter, it wlil just create a new line within the container. How would i go about adding a new container below it?

Thank you very much!
furtivefelon
 
Posts: 3
Joined: Fri Aug 07, 2009 3:24 pm

Re: insert new container after preformatted section (code)

Postby mr_lundis on Tue Oct 27, 2009 11:00 pm

Hello!
This is a more or less known problem for all kind of elements that breaks the WYMeditor default enter behaviour, but as far as I'm aware there's unfortunately no god fix available. I guess the most consistent solution would be to force a new paragraph every time the user hits enter and inserting a line brake on ctrl+enter. However, doing so makes editing tables really hard, and I think it would confuse a lot of users as it isn't always the expected behaviour. Another solution could be to exit the element whenever the user hits enter twice, much like with lists.

Any suggestions are welcome! ;)
Cheers!
Jonatan Lundin - designer, developer and forum moderator. You should follow me on Twitter!
mr_lundis
 
Posts: 335
Joined: Sun Dec 02, 2007 10:59 am
Location: Sweden

Re: insert new container after preformatted section (code)

Postby pathless on Thu Nov 12, 2009 3:19 am

"force a new paragraph every time the user hits enter and inserting a line brake on ctrl+enter"

How do you go about doing this?
pathless
 
Posts: 2
Joined: Fri Oct 09, 2009 3:27 am

Re: insert new container after preformatted section (code)

Postby mr_lundis on Thu Jan 07, 2010 11:55 am

You'd modify the event hander for keydown/up/press (I think there's on somewhere in the WYM source) to check when enter is pressed and whether or not the ctrl key was used or not and take action accordingly. It's the taking action part that is tricky, as there's a lot of different cases to consider (tables, pres, and pretty much all other block elements). This is a rather large job, and any help is greatly appreciated! ;)

Cheers! ;)
Jonatan Lundin - designer, developer and forum moderator. You should follow me on Twitter!
mr_lundis
 
Posts: 335
Joined: Sun Dec 02, 2007 10:59 am
Location: Sweden


Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest