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

html_to_text stripts images. It should replace the imge with its alt text

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 1.9.8
    • Fix Version/s: 1.9.10, 2.0
    • Component/s: Accessibility, Libraries
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE, MOODLE_20_STABLE

      Description

      This is a regression introduced by MDL-17542.

      Look at http://cvs.moodle.org/moodle/lib/html2text.php?r1=1.10&r2=1.11, and search for img. You will see that in the old library images were replace by their alt text. The new code just strips them. Please could we have a fix, which I guess will have to be contributed upstream.

        Gliffy Diagrams

          Activity

          Hide
          timhunt Tim Hunt added a comment -

          Adding a couple of watchers.

          Show
          timhunt Tim Hunt added a comment - Adding a couple of watchers.
          Hide
          timhunt Tim Hunt added a comment -

          Here is a proposed fix:
          http://github.com/timhunt/Moodle-Question-Engine-2/commit/8169577cb6050690ea4b9b2ff139001471f125c2

          Francois, you have dealt with the upstream people on this before. Please could you take this forwards.

          In the mean time, do we want this committed to any Moodle branches?

          Show
          timhunt Tim Hunt added a comment - Here is a proposed fix: http://github.com/timhunt/Moodle-Question-Engine-2/commit/8169577cb6050690ea4b9b2ff139001471f125c2 Francois, you have dealt with the upstream people on this before. Please could you take this forwards. In the mean time, do we want this committed to any Moodle branches?
          Hide
          timhunt Tim Hunt added a comment -

          Also, for the code I am writing that uses this, I would like to make this change:

          http://github.com/timhunt/Moodle-Question-Engine-2/commit/ec0c27531e3952c013de4e22c27d6d28412ac034#diff-0

          in weblib, so I can pass through $width = 0. Is it OK if I commit that?

          Show
          timhunt Tim Hunt added a comment - Also, for the code I am writing that uses this, I would like to make this change: http://github.com/timhunt/Moodle-Question-Engine-2/commit/ec0c27531e3952c013de4e22c27d6d28412ac034#diff-0 in weblib, so I can pass through $width = 0. Is it OK if I commit that?
          Hide
          skodak Petr Skoda added a comment -

          +1 for commit

          Show
          skodak Petr Skoda added a comment - +1 for commit
          Hide
          timhunt Tim Hunt added a comment -

          Checked in to 1.9 and HEAD, which a few simple unit tests.

          Show
          timhunt Tim Hunt added a comment - Checked in to 1.9 and HEAD, which a few simple unit tests.

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                25/Oct/10