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

automatically make a paragraph when users start typing?

Discuss features, code, contributions, ideas, suggestions, ...
For bugs, patches and feature requests, please post on the Trac:
http://trac.wymeditor.org/

automatically make a paragraph when users start typing?

Postby alfrombrum on Thu Jul 12, 2007 1:22 pm

hi,
is it possible to make is so that a paragraph is automatically made when users start typing?

at the moment, when there is no text and users start typing, the text is unformatted. to make a paragraph, users have to click on the 'b' or 'i' buttons (even selecting paragraph from the formatting menu doesn't work in 0.4 beta 2 - at least not in the code i copied from the demo page). since this is an unnecessary step, how can i make it so that a paragraph is automatically made when a user starts typing?

thanks,
al
alfrombrum
 
Posts: 3
Joined: Thu Jul 12, 2007 1:18 pm

Postby mcfang on Fri Jul 13, 2007 7:04 am

You can set it up so that you start with a paragraph instead of a blank canvas: pre-populate the editor div with "<p> </p>". Seems to work well in v0.2, YMMV.
mcfang
 
Posts: 4
Joined: Tue Feb 13, 2007 5:36 am

Postby alfrombrum on Fri Jul 13, 2007 2:07 pm

i can't get it to work.

if i change the initial textarea that the wymeditor replaces and put in <p> </p>, a white paragraph box is displayed, but when i click in it, the cursor goes to the end of that box, and new text is inserted below it, unformatted. i'm using firefox. apparently it works fine in ie.

thanks...
alfrombrum
 
Posts: 3
Joined: Thu Jul 12, 2007 1:18 pm

Postby jfh on Wed Jul 18, 2007 8:25 am

Does the demo work for you?
What's your FF version?
Where do you put the '<p></p>' ?
Do you get any error message?
User avatar
jfh
Site Admin
 
Posts: 370
Joined: Sat Sep 23, 2006 8:43 pm
Location: Belgium

Postby jfh on Wed Jul 18, 2007 1:42 pm

I think I see what's happening.
Please test with <p><br></p> instead of an empty paragraph. FF needs the <br> to edit it.
User avatar
jfh
Site Admin
 
Posts: 370
Joined: Sat Sep 23, 2006 8:43 pm
Location: Belgium

Postby ceejayoz on Fri Dec 14, 2007 9:28 pm

<p>&nbsp;</p> is probably better than a <br>. There just has to be non-whitespace text in there.
ceejayoz
 
Posts: 1
Joined: Fri Dec 14, 2007 9:27 pm


Return to Developers

Who is online

Users browsing this forum: No registered users and 2 guests