taoguan / jwysiwyg

Automatically exported from code.google.com/p/jwysiwyg
0 stars 0 forks source link

adds unwanted <br> tags #15

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Loading the editor
2. changing to HTML code
3. or typing something and than chaninging to html code

What is the expected output? What do you see instead?
Output in HTML code should be empty, see <br> instead.
Output in HTML code should be the text only, see text and <br> at the end
instead.

What version of the product are you using? On what operating system?
0.1 on xampp with firefox 2.0

Please provide any additional information below.
btw. how can i change the code to XHTML that wanted <br> are inserted
correctly as <br /> ?

Original issue reported on code.google.com by damrgee@gmail.com on 1 Mar 2008 at 8:00

GoogleCodeExporter commented 8 years ago
Hi,

That's becouse when the editor is initialized and no content is load from 
textarea,
it put an <br>. I don't remember what problem I found if I didn't append it, 
but I
thing I could change it for another thing.

Original comment by joksnet on 6 Mar 2008 at 10:06

GoogleCodeExporter commented 8 years ago
Hi!

I have already changed those line for the initial <br> to

            if ( this.initialContent.length == 0 )
                this.setContent('');

The problem is that when using the editor, sometimes <br> tags are still added 
at the
end (without making a new linebreak). I can not 100% reproduce. Sometimes it 
happens
if you copy and paste (unformated) text, sometimes if you just click and type.

Also: I would need to change the tags to be proper XHMTL (<br />) Where can I 
do that?

Original comment by damrgee@gmail.com on 7 Mar 2008 at 6:59

GoogleCodeExporter commented 8 years ago
Hi,

I change the code the line for the initial content. But i can't reproduce the 
other
error. To make XHTML is not a priority.

Original comment by joksnet on 12 Mar 2008 at 1:57

GoogleCodeExporter commented 8 years ago
I can now reproduce when the editor adds an unwanted <br> at the end.

a.) When i click in the box and write one word only - than not
b.) When i click in the box and write a word THEN a space THEN another word - 
than
the <br> is added (switching to HTML view)...

ad XHTML:
So if you want a simple valid XHTML code instead of <br> a <br /> that's not 
possible
you mean?  

Original comment by damrgee@gmail.com on 12 Mar 2008 at 4:19

GoogleCodeExporter commented 8 years ago
Fixed on r16.

Original comment by joksnet on 22 Mar 2008 at 1:51

GoogleCodeExporter commented 8 years ago
thanks. paypal donation on it's way ;-)

Original comment by damrgee@gmail.com on 24 Mar 2008 at 4:22

GoogleCodeExporter commented 8 years ago
I want to thank you for the donation, even I do this coding because I like, 
it's nice
to be thanked in that way.

About the XHTML, I don't insert the <br>, so I can't change it for <br />. All
depends what browser you use. For example, in FF when you bold some text put 
<span
class="font-weight: bold;"> and in IE puts the  tag.

The command *styleWithCSS* let you to use CSS instead of tags, but is not 
compatible
with IE http://www.quirksmode.org/dom/execCommand.html

Regards,

Original comment by joksnet on 24 Mar 2008 at 4:43

GoogleCodeExporter commented 8 years ago
What if you just replace the <br> with <br /> 's?

Original comment by bakerm...@gmail.com on 19 Dec 2008 at 12:18

GoogleCodeExporter commented 8 years ago
Don't forget: If you change to the <br /> tags, you will also need to change 
the math
in lines 612-616 to subtract 6 instead of 4, like so:

                if ( this.options.rmUnwantedBr )
        {
                    content = ( content.substr(-6) == '<br />' ) ? content.substr(0,
content.length - 6) : content;
        }

Original comment by nsfreri...@gmail.com on 1 Mar 2010 at 2:48

GoogleCodeExporter commented 8 years ago
BTW - You can change the <br> tags to proper XHTML <br /> tags. See Issue 165 
for
instructions on how to do this and change the  and <i> tags to <strong> and <em>
as well.

Original comment by nsfreri...@gmail.com on 1 Mar 2010 at 2:49

GoogleCodeExporter commented 8 years ago
sasa

Original comment by ds190...@gmail.com on 9 Jun 2012 at 9:38