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

Image in preformatted (<pre>) tag disappears for students

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Major Major
    • None
    • 4.5.1
    • Assignment, Book, Forum
    • None
    • MOODLE_405_STABLE

      When adding an image to a Moodle page resource and wrapping it within a <pre> HTML tag, the image is visible to teachers but disappears for students. This issue affects the "Page" resource and also occurs in other resource types or activity descriptions.

       
      Steps to reproduce the issue

      1. Log in as a teacher.
      2. Create a page resource in any course.
      3. Add an image to the page.
      4. Select the image and:
        Format it as "Preformatted," or
        Manually edit the HTML to wrap the <img> tag within a <pre> tag.
      5. Save and view the page:
        As a teacher, the image is visible.
      6. Log in as a student and view the same page:
        As a student, the image is not visible, and the <img> tag is missing from the generated HTML.

      Expected behavior

      The image should remain visible to all users, including students, regardless of whether it is placed inside a <pre> tag.

      Actual behavior

      The <img> tag is removed from the HTML for students when it is placed inside a <pre> tag, making the image invisible. However, teachers can still view the image.

      Additional note: The issue could be related to a content filtering or sanitization mechanism that behaves differently for students and teachers.

            Unassigned Unassigned
            jcrodriguez Juan Carlos Rodriguez del Pino
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.