Enter-key in IE causes double line spacing

Enter-key in IE causes double line spacing

by Lars Jensen -
Number of replies: 8

Hitting the Enter key in IE results in double line spacing - this seems like a bug. Hitting Enter in other browsers like Mozilla and Netscape doesn't cause this behavior of this editor.

Lars.

Average of ratings: -
In reply to Lars Jensen

Re: Enter-key in IE causes double line spacing

by Janne Mikkonen -
Picture of Core developers
Hi Lars.

Well it's not a bug big grin. If you'll ever use FrontPage or Dreamweaver you'll see exactly same behavior.
When you hit enter key, you are making a new paragraph not a linebreak. If you wish to make linebreak, keep the shift button pressed while hitting enter key.

Gecko based browser's implement this "editmode" a littlebit differently than MSIE wink.

- Janne -
In reply to Janne Mikkonen

Re: Enter-key in IE causes double line spacing

by Timothy Takemoto -

I saw somewhere that html area recently added the much request function of interpreting enter as a break and not as a <p>. Or perhaps it just displayed <p> differently.

I find that I get so used to typing into moodle text boxes that I keep pressing shift in other applications, and this causes problems when it comes to formatting (such as making bullet lists).

Aha...at the html area forums there is a hack supplied by the chief developer of htmlarea

The problem with this would be that bullet lists would not then work in this html area as mentioned here

Perhaps the thrid solution from the head designer here might work for some sort of <p></p>with a style tag that reduces the amount of line spacing.

Yes... there are two other proposed solutions here including one which uses style.

2) p { margin-top: 0em; margin-bottom: 0em; }

Does this work? hmmm.... if I put the above in the style definition of my theme then I imagine it will cause problems everywhere. Perhpas this can be put into one of the tags that surround the text areas? such as

<textarea cols="" rows="" name="YourTextareaName" style="width:97%; height:320; p { margin-top: 0em; margin-bottom: 0em; }"></textarea>
I am not sure if one can put {} inside ""

Or, my suggestion, using the third solution here so that pressing enter added <p style="margin-top: 0em; margin-bottom: 0em; "></p style="default">

Tim

In reply to Timothy Takemoto

Re: Enter-key in IE causes double line spacing

by Genner Cerna -

Try pressing ctrl+enter, that will give you single newline...

In reply to Genner Cerna

Re: Enter-key in IE causes double line spacing

by Timothy Takemoto -

Dear Genner Cerna,
  Pressing ctrl+enter does not seem to do anything for me but the usual shift+enter works for ME but not for my non-computer savvy students. It causes untold pain (I hear).Since the software they are used to using (and they are not used to using dreamweaver) such as Word or Openoffice.org or Excel or Power Point or Notepad, or the plain text areas of IE gives a single space, there is simply a learnin curve before one can get used to pressing shift+enter in Moodle and enter in all other software. After a year of using Moodle I am not over the learning curve and these days press shift+enter in Word, meaning that indentation, centering, and lists do not work as expected.

How about somethign like this in the style sheet???

textarea. p { margin-top: 0em; margin-bottom: 0em; }

Tim

In reply to Timothy Takemoto

Re: Enter-key in IE causes double line spacing

by Genner Cerna -

I see, try adding it in the css than adding in the scripts... I'm testing it rigth now...

In reply to Genner Cerna

Re: Enter-key in IE causes double line spacing

by Timothy Takemoto -

Gennna,
I tried it in mine.
p.textarea { margin-top: 0em; margin-bottom: 0em; }
textarea.p { margin-top: 0em; margin-bottom: 0em; }
don't seem to do anything but
p { margin-top: 0em; margin-bottom: 0em; }
produces a more compact line spacing that I quite like. I wonder if it causes problems anywhere?

It sill means that pressing enter results in a double space inside this text area, but when I post my post, then that post is displayed with less space between the paragraphs.

I wonder if
p { margin-top: 0em; margin-bottom: 0em; }
causes any problems?
Tim  

In reply to Janne Mikkonen

Re: Enter-key in IE causes double line spacing

by Sue Somit -
Janne,
Is there a list in the Moodle site of other keystrokes that might not be obvious to the new or not proficient html user? I really appreciated the Shift-Enter information.
Thanks, Sue
In reply to Sue Somit

Re: Enter-key in IE causes double line spacing

by Janne Mikkonen -
Picture of Core developers
No I don't think there are any thoughtful.

But any other short cut keys should function as they do in most of text editors (except clean Word HTML short cut key is CTRL + 0, control + zero).