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

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

    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.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              quen Sam Marshall added a comment -

              added pull request PULL-366 ready for review (whenever, no rush)

              Show
              quen Sam Marshall added a comment - added pull request PULL-366 ready for review (whenever, no rush)
              Hide
              tsala Helen Foster added a comment -

              Thanks again Sam.

              Show
              tsala Helen Foster added a comment - Thanks again Sam.

                People

                • Assignee:
                  quen Sam Marshall
                  Reporter:
                  quen Sam Marshall
                  Tester:
                  Eloy Lafuente (stronk7)
                  Participants:
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

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