Moodle

html WYSIWYG editor loses indent in forums and wiki on 1.9+

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Won't Fix
  • Affects Version/s: 1.9
  • Fix Version/s: None
  • Component/s: Forum
  • Labels:
    None
  • Environment:
    RHEL 4AS with PHP 5.2.5, and MySQL 5.x
  • Database:
    MySQL
  • Affected Branches:
    MOODLE_19_STABLE

Description

In our Moodle 1.9+ there is a problem with the html WYSIWYG editor. If a user creates either a forum post or a wiki entry using it, and enters an indent using the indent button, this indent is lost on the post. It is reproducible 100% of the time. It is also referenced in a comment in ticket MDL-13886.

Issue Links

Activity

Hide
Matthew Davidson added a comment - - edited

Any progress on this? It looks like the styles are being stripped out.

Show
Matthew Davidson added a comment - - edited Any progress on this? It looks like the styles are being stripped out.
Hide
Greg Rodenhiser added a comment -

No, nothing yet

Show
Greg Rodenhiser added a comment - No, nothing yet
Hide
Matt Jenner added a comment -

Sadly I have also just discovered this. We are using Moodle 1.9.

Is there any suggested workaround?

Show
Matt Jenner added a comment - Sadly I have also just discovered this. We are using Moodle 1.9. Is there any suggested workaround?
Hide
Martin Dougiamas added a comment -

This has bothered me too. Nicolas, can you please just look into the problem and identify what is going on? We have a new editor in 2.0 so it might not be worth fixing if it's a lot of work ... but if it can be fixed easily that would be nice.

Show
Martin Dougiamas added a comment - This has bothered me too. Nicolas, can you please just look into the problem and identify what is going on? We have a new editor in 2.0 so it might not be worth fixing if it's a lot of work ... but if it can be fixed easily that would be nice.
Hide
Nicolas Connault added a comment - - edited

I can't reproduce this with the 1.9 wiki or forum, using the default theme. The resulting HTML is:

no indenting<br /><div style="margin-left:40px;">indenting 1<br /><div style="margin-left:40px;">indenting 2<br /></div></div>

See attached screenshot

Show
Nicolas Connault added a comment - - edited I can't reproduce this with the 1.9 wiki or forum, using the default theme. The resulting HTML is: no indenting<br /><div style="margin-left:40px;">indenting 1<br /><div style="margin-left:40px;">indenting 2<br /></div></div> See attached screenshot
Hide
Matt Jenner added a comment -

With that exact HTML and a copy of Moodle 1.9.3 (Build: 20081015) I can't have indented paragraphs within a wiki, it kicks back this html:

no indenting<br />
<div>indenting 1<br />
<div>indenting 2<br /></div></div>

It seems to me that it's down to how the htmlarea transposes text, if it makes it a div tag, the margin indent tries to make it a margin-left:40px. However, if it is a <p> tag it'll add blockquotes, which work perfectly fine.

I don't know if this helps?

Show
Matt Jenner added a comment - With that exact HTML and a copy of Moodle 1.9.3 (Build: 20081015) I can't have indented paragraphs within a wiki, it kicks back this html: no indenting<br /> <div>indenting 1<br /> <div>indenting 2<br /></div></div> It seems to me that it's down to how the htmlarea transposes text, if it makes it a div tag, the margin indent tries to make it a margin-left:40px. However, if it is a <p> tag it'll add blockquotes, which work perfectly fine. I don't know if this helps?
Hide
Nicolas Connault added a comment -

OK I found the cause. It is because of the HTML purifier, KSES. If you go to the experimental section of the admin menu, you will find a setting called enablehtmlpurifier. If you switch this on, your problem will be resolved.

In the meantime, I am looking at why KSES strips these simple styles from the posts.

Show
Nicolas Connault added a comment - OK I found the cause. It is because of the HTML purifier, KSES. If you go to the experimental section of the admin menu, you will find a setting called enablehtmlpurifier. If you switch this on, your problem will be resolved. In the meantime, I am looking at why KSES strips these simple styles from the posts.
Hide
Nicolas Connault added a comment - - edited

See MDL-16291 for the real cause

Show
Nicolas Connault added a comment - - edited See MDL-16291 for the real cause
Hide
Michael de Raadt added a comment -

Thanks for reporting this issue.

We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported.

If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed.

Michael d;

lqjjLKA0p6

Show
Michael de Raadt added a comment - Thanks for reporting this issue. We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported. If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed. Michael d; lqjjLKA0p6
Hide
Michael de Raadt added a comment -

I'm closing this issue as it appears to have become inactive and is probably not relevant to a current supported version. If you are encountering this problem or one similar, please launch a new issue.

Show
Michael de Raadt added a comment - I'm closing this issue as it appears to have become inactive and is probably not relevant to a current supported version. If you are encountering this problem or one similar, please launch a new issue.

Dates

  • Created:
    Updated:
    Resolved: