Moodle

Tidy filter removes the "font" tags, but HTML editor puts it when you format the text.

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Duplicate
  • Affects Version/s: 1.8.11, 1.9.7
  • Fix Version/s: None
  • Component/s: Filters
  • Labels:
    None
  • Environment:
    tidy filter active.
  • Affected Branches:
    MOODLE_18_STABLE, MOODLE_19_STABLE

Description

By adding a label on a course and format text (using HTML editor) with the font color, font size, etc.
The text is not formatted, but the filter "tidy" deletes the "font" tags.

The code "moodle / filter / tidy / filter.php" shows:

$tidyoptions = array(
.....
'drop-font-tags' => true,
....

Solution:

$tidyoptions = array(
.....
'drop-font-tags' => false, <--- This line must be set to false to solve this problem.
....

Issue Links

Activity

Hide
Eloy Lafuente (stronk7) added a comment -

Hi JR,

main problem here is that the tidy filter is aimed to produce correct XHTML results and FONT tags aren't allowed there, hence the default setting defined to drop them. And there are a bunch of Moodle installations requiring that, so we cannot, simply, change current behavior.

Perhaps it would be more interesting to, alternatively:

1) Allow configuration of the filter, so ppl can decide (using current settings as default).
2) Instead of setting it to "no", perhaps enabling the "clean" option could be interesting, as far as it uses to convert those tags into proper css styles/rules. Note I haven't tested it, just read the documentation at: http://tidy.sourceforge.net/docs/quickref.html#clean

Ciao

Show
Eloy Lafuente (stronk7) added a comment - Hi JR, main problem here is that the tidy filter is aimed to produce correct XHTML results and FONT tags aren't allowed there, hence the default setting defined to drop them. And there are a bunch of Moodle installations requiring that, so we cannot, simply, change current behavior. Perhaps it would be more interesting to, alternatively: 1) Allow configuration of the filter, so ppl can decide (using current settings as default). 2) Instead of setting it to "no", perhaps enabling the "clean" option could be interesting, as far as it uses to convert those tags into proper css styles/rules. Note I haven't tested it, just read the documentation at: http://tidy.sourceforge.net/docs/quickref.html#clean Ciao
Hide
Eloy Lafuente (stronk7) added a comment -

modifying versions and assigning to Martin to re-assign/comment. Sounds like easily achievable IMO.

Show
Eloy Lafuente (stronk7) added a comment - modifying versions and assigning to Martin to re-assign/comment. Sounds like easily achievable IMO.
Hide
Eloy Lafuente (stronk7) added a comment -

Sorry, closing this as dupe of MDL-9230 (that already has more votes/watchers), plz JR follow this issue there.

Ciao

Show
Eloy Lafuente (stronk7) added a comment - Sorry, closing this as dupe of MDL-9230 (that already has more votes/watchers), plz JR follow this issue there. Ciao

People

Dates

  • Created:
    Updated:
    Resolved: