We are having problems with nested tags. Some things work great, others I don't understand. I like the cleaning of the code by adding and removing appropriate tags. But I do not think we can use this feature because it adds blank lines. I am guessing that the third line below is wrapped in a paragraph tag as soon as it hits any close tag and the program then sees the close paragraph tag and adds the open tag to make it correct. Ideally we would like it to discard unused close tags as well as open tags.
<p>Testing New Paragraph.
<p>Testing 2nd Paragraph</p>
Is everything OK? How is this 1st paragraph looks? Is it fine?</p>
turns into this:
<p>Testing New Paragraph.</p>
<p>Testing 2nd Paragraph</p>
<p>Is everything OK? How is this 1st paragraph looks? Is it fine?</p>
<p> </p>
This is great except the last line.
Also I would like <p><p>xxxxx</p>xxxx</p> to become <p>xxxxx</p><p>xxxx</p> currently it adds a empty paragraph at the begining as well
Is any of this possible for us to fix or do we need to turn of this ability.
<p>Testing New Paragraph.
<p>Testing 2nd Paragraph</p>
Is everything OK? How is this 1st paragraph looks? Is it fine?</p>
turns into this:
<p>Testing New Paragraph.</p>
<p>Testing 2nd Paragraph</p>
<p>Is everything OK? How is this 1st paragraph looks? Is it fine?</p>
<p> </p>
This is great except the last line.
Also I would like <p><p>xxxxx</p>xxxx</p> to become <p>xxxxx</p><p>xxxx</p> currently it adds a empty paragraph at the begining as well
Is any of this possible for us to fix or do we need to turn of this ability.
Re: Nested paragraph tags.
<p><p>xxxxx</p>xxxx</p>
Is actually interpreted by any browser as
<p></p>
<p>xxxxx</p>
xxxx
The last series of x's is not a paragraph, just inline text. Some browsers may insert an empty paragraph at the end to fix broken HTML (e.g. FF will, Opera will not).
In other words, you cannot have what you are looking for. FCKeditor is an HTML editor, not a notepad.
Re: Nested paragraph tags.
People using the editor on our pages are cutting and pasting from places where it is used like that. As I said, I like the feature that cleans this code up. However in some cases, it does not clean it correctly.
a<p><p>xxxxx</p>xxxx</p>a
should be interpreted close to what you said: (a's added for clarity)
FF interprets it like:
a<p></p><p>xxxxx</p>xxxxa - which is the same as
a<p/><p>xxxxx</p>xxxxa - which is the same as
a<p>xxxxx</p>xxxxa
Strange as it seams IE interprets it more correctly in one way less in another:
a<p>xxxxx</p><p>xxxx</p>a
I don't really care which the DCKeditor does. But I don't want it to do this:
a<p> </p><p>xxxxx</p><p>xxxx</p>a
and for this:
a<p><p>xxxxx</p>xxxx</p>
I dont want it to do this
a<p> </p><p>xxxxx</p><p>xxxx</p><p> </p>
I hope this makes it more clear.
Re: Nested paragraph tags.
Having said this, I'll add that there seems to be high demand for something like JavaScript-based HTML Tidy. May be FCKeditor team could look into this. It would make a nice feature - people always find ways to make mess out of HTML.
Re: Nested paragraph tags.
In a test done by my co-worker using the FCKeditor:
<p>Testing New Paragraph.
<p>Testing 2nd Paragraph</p>
Is everything OK? How is this 1st paragraph looks? Is it fine?</p>
becomes
<p>Testing New Paragraph.</p>
<p>Testing 2nd Paragraph</p>
<p>Is everything OK? How is this 1st paragraph looks? Is it fine?</p>
<p> </p>
I am fine with this, except the black line at the end, even though as you point out, it is working differently than we think it should be. As I said before, two open paragraph tags in a row also adds a blank line. As you say this should not happen. So how do I make it not happen. I don't care if it emulates FF because then I can tell users that it is doing it the way most browsers do or if it copies IE because then it works the way most users browsers do. But it should work like one of the main browsers.
If we can not stop this insertion of blank lines how do we get the editor to leave all paragraph tags alone?
Re: Nested paragraph tags.
A further update to this issue:
it appears that the first paragraph that is nested inside another is moved to the bottom of the document, the end tag of the outside paragraph tag set gets converted to an empty paragraph tag an then to a <p> </p>
In this case, clicking the source button changes the order of the paragraphs, but eventually puts them back in the same order adding <p> </p> which of course creates the spaces that is one of our issues.
Before:
After clicking the source button 11 times, (each click changes the code and usually the order), the code from above becomes:
Re: Nested paragraph tags.
Re: Nested paragraph tags.
it completes open paragraphs to become:
<p>a</p><p>b</p>c<p></p>
it raps non-contained content in a paragraph to become:
<p>a</p><p>b</p><p>c</p></p>
it fixes any closed paragraphs without an open to become:
<p>a</p><p>b</p><p>c</p><p> </p>
I am not sure of the order as the JS is a little hard to wade through.
So to answer your question, any file with improper coding that leaves an aliased close paragraph tag. I have even managed to get it to insert lines with the code it generates its self. But have not found a way to reproduce it consistently. The line the empty paragraph ends up on is whatever line the end tag is on.
I hope that helps. No one seems to have any clue how to answer my questions. We have determined that FCK Editor may be too buggy for us to use.