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

HTML5 semantic elements shouldn't be stripped out (when logged-in-as)

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.7.4, 3.8
    • Fix Version/s: None
    • Component/s: Filters
    • Labels:
    • Affected Branches:
      MOODLE_37_STABLE, MOODLE_38_STABLE

      Description

      Currently, many HTML5 elements (e.g. figure, figcaption, aside) are stripped out by HTML Purifier, unless you're a trusted user - i.e. not a student.

      Stripping these elements prevents improved semantics in the content, and breaks imported HTML (e.g. imported into Book activities) for some users (whilst leaving it intact for others, which obscures the changes made by HTML Purifier).

      EDIT: It turns out that usually the elements aren't stripped in Books, but I was viewing one via log-in-as, which (since MDL-63786) forces text cleaning on for logged-in-as sessions.

      Adding HTML5 definitions to HTML Purifier could be done by adding individual rules for each element (like MDL-54847, which added in support for the audio, video, and source elements), or perhaps by vendoring an existing solution (e.g. https://github.com/xemlock/htmlpurifier-html5).

      Support for the semantic elements could be added to Atto later, or via plugins.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              balchd Dave Balch
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona)
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated: