Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-26423

Add option so that format_text (with htmlpurifier) does not remove id attribute

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.2
    • Fix Version/s: 2.0.3
    • Component/s: Libraries
    • Labels:
    • Difficulty:
      Moderate
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      With htmlpurifier enabled, format_text removes the 'id' attribute. This causes a problem for the ouwiki module, which uses id to store data associated with the user content.

      I propose to change format_text to add a new option

      allowid = true (default false); allow the id attribute to be preserved even when cleaning is applied

      If set, this will pass through eventually to HTMLPurifier as
      $config->set('HTML.EnableAttrID', true)

      (When htmlpurifier is not enabled, there is no need to pass it through to the 'old' cleaning method, as that one does not remove id attribute anyway)

      Petr has agreed this is a reasonable approach and we can submit a PULL request for 2.0.3, subject to review.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                quen Sam Marshall
                Reporter:
                quen Sam Marshall
                Tester:
                Eloy Lafuente (stronk7)
                Participants:
                Component watchers:
                Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  5/May/11