htmlArea

A directory of browser-based WYSIWYG editors

  MAIN
INDEX
SEARCH
POSTS
WHO'S
ONLINE
LOG
IN

Home: WYSIWYG Forums: WYSIWYG Editor Discussion:
how to replace <p> to <br> in htmlarea


 


dewi
New User

Mar 30, 2005, 6:16 AM

Post #1 of 3 (38544 views)
Shortcut
how to replace <p> to <br> in htmlarea Can't Post

Hello

i am installing the htmlarea beta and i would like to know how to replace <p> into <br>

or, i want to reduce spacing of the <p>. I think now the <p> = double space.



thanks

xxx


scottiemac
Novice

May 14, 2005, 8:39 PM

Post #2 of 3 (38349 views)
Shortcut
Re: [dewi] how to replace <p> to <br> in htmlarea [In reply to] Can't Post

Shift+enter gives you a single line break.


clay
New User

Mar 21, 2007, 6:26 AM

Post #3 of 3 (36614 views)
Shortcut
Re: [scottiemac] how to replace <p> to <br> in htmlarea [In reply to] Can't Post

Here is a work around for IE and putting in a single line break

Put this code in the function: HTMLArea.prototype._editorEvent = function(ev)

Place it as the else if to the "if (cmd) {"

else if (keyEvent && HTMLArea.is_ie && ev.keyCode == 13) {
this.insertHTML("<br/><br/>");
ev.keyCode=8;
}

This isn't the prettiest solution but it works. Basically this will capture the enter key and replace the normal "<p>" with 2 "<BR>" tags. Then setting the event code to 8 (delete) it will remove one. It will update the cursor as well.

 
 
 


Search for (options)