Defect #207

Too much <p> tags are added automatically

Added by Francois Mazerolle over 1 year ago. Updated over 1 year ago.

Status:Closed Start date:08.09.2010
Priority:High Due date:
Assignee:- % Done:

100%

Category:-
Target version:-
Browser:

Description

Hi,

I would like to write in Russian, but I'm french, so english is the best compromise I can make :p

How to reproduce:
--------------------
1. Create an editor with thoses settings:
<textarea id="bio" style="width:500px;">{$user->getBio()}</textarea>
<script type="text/javascript" charset="utf-8">
$().ready(function() {
var opts = {
cssClass : 'el-rte',
lang : 'fr',
height : 350,
toolbar : 'compact',
cssfiles : ['css/elrte-inner.css']
}
$('#bio').elrte(opts);
})
</script>

2. Go in the editor, now type: "testtest"
3. Underline 'tt' and click the Bold button.
4. The HTML is now:
tes<strong>tt</strong>est
5. Now save the data in the database.

6. Comme back on the page, in order to have the previously saved data loaded by defaut. The HTML should be:
<textarea id="bio" style="width:500px;">tes<strong>tt</strong>est</textarea>
<script type="text/javascript" charset="utf-8">
$().ready(function() {
var opts = {
cssClass : 'el-rte',
lang : 'fr',
height : 350,
toolbar : 'compact',
cssfiles : ['css/elrte-inner.css']
}
$('#bio').elrte(opts);
})
</script>

7. Now look the content of the editor: the 'testtest' word is now broken appart

Expected result:

I would expect that elRte doesn't re-interpret the code loaded by defaut. I would expect to see this in the Source Code tab:
tes<strong>tt</strong>est

Bad result:

The editor parse the code and wrong line break appear because of new <p> tags. The Source Code tab show:
<p>tes</p><strong>tt</strong><p>est</p>

... but the page HTML source code is:
<textarea id="bio" style="width:500px;">tes<strong>tt</strong>est</textarea>
<script type="text/javascript" charset="utf-8">
$().ready(function() {
var opts = {
cssClass : 'el-rte',
lang : 'fr',
height : 350,
toolbar : 'compact',
cssfiles : ['css/elrte-inner.css']
}
$('#bio').elrte(opts);
})
</script>

This is really problematic, as it make the editor totally useless in some case (like mine).
Will it be hard to fix ?

I'm able to code a bit, so if I can figure out what part of the code is in fault, I could take a look...

Associated revisions

Revision 0a0947ed
Added by Dmitry Levashov over 1 year ago

closes #207

History

Updated by Dmitry Levashov over 1 year ago

As temporary solution set

allowTextNodes : false

in elrte config

Updated by Francois Mazerolle over 1 year ago

Dmitry Levashov wrote:

As temporary solution set [...] in elrte config

Hum, It seem to have no effect at all.
Also, the styleWithCss : true, option seem to have no effect, I still have <strong>, and not <span style="font-weight:bold;">.
Note: Yes, I'm starting from scratch with an empty content before each test.

Here is the actual code that I've tested, and I still have the exact same problem:
<textarea id="bio" style="width:500px;">tes<strong>tt</strong>est</textarea>
<script type="text/javascript" charset="utf-8">
$().ready(function() {
var opts = {
cssClass : 'el-rte',
allowTextNodes : false,
styleWithCss : true,
lang : 'fr',
height : 350,
toolbar : 'compact',
cssfiles : ['css/elrte-inner.css']
}
$('#bio').elrte(opts);
})
</script>

Duh, I don't feel like this update will help much...

Updated by Francois Mazerolle over 1 year ago

Am I the only one with this bug ?
Anyone else can reproduce ?

If I'm doing something bad, I would like to know, and I'll be really happy to close this issue.

Updated by Dmitry Levashov over 1 year ago

Closes

Updated by Anonymous over 1 year ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

Updated by Francois Mazerolle over 1 year ago

Closed ?

This bug is still active, and no patch or no solution as been given.
This is a MAJOR BUG as it render the editor totally useless to manage small amount of content.

Also available in: Atom PDF