Moodle
  1. Moodle
  2. MDL-30470

HTML purifier modifies HTML of nested lists in Forum, Wiki, Blog, but not in Page

    Details

    • Testing Instructions:
      Hide

      Enter the HTML above in the source of an HTML formatted Wiki page. It should produce nested lists.

      Show
      Enter the HTML above in the source of an HTML formatted Wiki page. It should produce nested lists.
    • Affected Branches:
      MOODLE_22_STABLE, MOODLE_25_STABLE

      Description

      After entering the following HTML source into a Wiki page (in HTML format) the lists are separated in the recorded HTML. I suspect there must be some filtering going on in the Wiki code itself. I believe that TinyMCE is passing on the correct source.

      <p>Some text</p>
      <ol>
      <li>Bli</li>
      <li>Bla
      <ul>
      <li>Ha</li>
      <li>Ho</li>
      </ul>
      </li>
      <li>Blu</li>
      </ol>
      <p>More text.</p>
      <ul>
      <li>Bli</li>
      <li>Bla
      <ol>
      <li>Ha</li>
      <li>Ho</li>
      </ol>
      </li>
      <li>Blu</li>
      </ul>
      <p>More text.</p>
      

        Gliffy Diagrams

        1. blog_after.png
          63 kB
        2. blog_before.png
          59 kB
        3. blog_display.png
          29 kB
        4. HTML in TinyMCE.jpg
          47 kB
        5. Resulting rendered Wiki page.jpg
          21 kB

          Issue Links

            Activity

            Hide
            Michael de Raadt added a comment -

            This is the HTML that is saved by the Wiki:

            <p>Some text</p>
            <ol><li>Bli</li>
            <li>Bla</li>
            </ol><ul><li>Ha</li>
            <li>Ho</li>
            </ul>Blu
             
            <p>More text.</p>
            <ul><li>Bli</li>
            <li>Bla</li>
            </ul><ol><li>Ha</li>
            <li>Ho</li>
            </ol>Blu
             
            <p>More text.</p>
            

            Show
            Michael de Raadt added a comment - This is the HTML that is saved by the Wiki: <p>Some text</p> <ol><li>Bli</li> <li>Bla</li> </ol><ul><li>Ha</li> <li>Ho</li> </ul>Blu   <p>More text.</p> <ul><li>Bli</li> <li>Bla</li> </ul><ol><li>Ha</li> <li>Ho</li> </ol>Blu   <p>More text.</p>
            Hide
            Helen Foster added a comment -

            Just noting another report of this problem in the forums - http://moodle.org/mod/forum/discuss.php?d=192632

            Show
            Helen Foster added a comment - Just noting another report of this problem in the forums - http://moodle.org/mod/forum/discuss.php?d=192632
            Hide
            Curtis Fornadley added a comment -

            There does not seem to be any traction/progress on this. At UCLA we are getting push back from our users to campus because this is such a mess. This may delay our migration to M2. The bad formatting negates the benefits of the new text/html editor. Thanks for any status update

            Show
            Curtis Fornadley added a comment - There does not seem to be any traction/progress on this. At UCLA we are getting push back from our users to campus because this is such a mess. This may delay our migration to M2. The bad formatting negates the benefits of the new text/html editor. Thanks for any status update
            Hide
            Charles Fulton added a comment - - edited

            This appears to be a problem with HTMLPurifier: http://htmlpurifier.org/phorum/read.php?3,5451. Are there plans to upgrade to 4.4.0? I was able to reproduce this issue with a forum as well.

            Show
            Charles Fulton added a comment - - edited This appears to be a problem with HTMLPurifier: http://htmlpurifier.org/phorum/read.php?3,5451 . Are there plans to upgrade to 4.4.0? I was able to reproduce this issue with a forum as well.
            Hide
            Charles Fulton added a comment -

            To clarify my last comment, I'm not saying that HTMLPurifier is buggy. Rather, it sounds like TinyMCE is outputting code that isn't standards compliant, and HTMLPurifier was rewritten to support that code.

            Show
            Charles Fulton added a comment - To clarify my last comment, I'm not saying that HTMLPurifier is buggy. Rather, it sounds like TinyMCE is outputting code that isn't standards compliant, and HTMLPurifier was rewritten to support that code.
            Hide
            Petr Skoda added a comment -

            hopefully htmlpurifier 4.4.0 will be in the next weekly build, thanks

            Show
            Petr Skoda added a comment - hopefully htmlpurifier 4.4.0 will be in the next weekly build, thanks
            Hide
            Eloy Lafuente (stronk7) added a comment -

            Note that MDL-31785 has been integrated. So it will be worth revisiting this after March 8th 2012, running an upgraded version.

            Ciao

            Show
            Eloy Lafuente (stronk7) added a comment - Note that MDL-31785 has been integrated. So it will be worth revisiting this after March 8th 2012, running an upgraded version. Ciao
            Hide
            Michael de Raadt added a comment -

            I'm still seeing the same output in the latest integration version.

            Show
            Michael de Raadt added a comment - I'm still seeing the same output in the latest integration version.
            Hide
            Charles Fulton added a comment -

            I tested this on a local dev environment and qa.moodle.net and it appears to behave correctly now. If someone can verify I think we can close this one.

            Show
            Charles Fulton added a comment - I tested this on a local dev environment and qa.moodle.net and it appears to behave correctly now. If someone can verify I think we can close this one.
            Hide
            Rex Lorenzo added a comment -

            I tested the HTML editor when you add a page resource and that works. But if you try to add a blog entry I find that the nested lists are still broken. Please see attached images for my test on qa.moodle.net.

            Show
            Rex Lorenzo added a comment - I tested the HTML editor when you add a page resource and that works. But if you try to add a blog entry I find that the nested lists are still broken. Please see attached images for my test on qa.moodle.net.
            Hide
            Charles Fulton added a comment -

            @Rex: that looks like a different issue altogether. You're trying to nest an unordered list within an ordered list (or vice versa). I'm not sure how that's supposed to work. You might want to create a separate issue for that. Indented lists of the same type seem to work properly.

            Show
            Charles Fulton added a comment - @Rex: that looks like a different issue altogether. You're trying to nest an unordered list within an ordered list (or vice versa). I'm not sure how that's supposed to work. You might want to create a separate issue for that. Indented lists of the same type seem to work properly.
            Hide
            Rex Lorenzo added a comment -

            Is there something in the HTML spec that you cannot have nested lists of different types? We commonly use nested lists of ordered and unordered lists for writing agendas.

            I did some more testing and the forum also has the same problem.

            Why does the Page resource not have the same problem, but other modules that use the HTML editor?

            Also, I don't think I need to create a new issue, because the images posted by Michael de Raadt to report this bug has an example of nested lists with different types.

            Show
            Rex Lorenzo added a comment - Is there something in the HTML spec that you cannot have nested lists of different types? We commonly use nested lists of ordered and unordered lists for writing agendas. I did some more testing and the forum also has the same problem. Why does the Page resource not have the same problem, but other modules that use the HTML editor? Also, I don't think I need to create a new issue, because the images posted by Michael de Raadt to report this bug has an example of nested lists with different types.
            Hide
            Michael de Raadt added a comment -

            I can confirm that the problem still exists in Blog, Wiki and Forum, but not in Page. I suspect the HTML purifier is being applied differently on the Page's settings.

            Show
            Michael de Raadt added a comment - I can confirm that the problem still exists in Blog, Wiki and Forum, but not in Page. I suspect the HTML purifier is being applied differently on the Page's settings.
            Hide
            Rex Lorenzo added a comment -

            Tested this on the QA site running the latest 2.5 master and the problem still exists.

            Show
            Rex Lorenzo added a comment - Tested this on the QA site running the latest 2.5 master and the problem still exists.
            Hide
            Rex Lorenzo added a comment -

            I fixed the HTML for lists to make the embedded list as part of the parent list li tags and looks to be fixed now.

            When you try to make lists within lists via the HTML editor it produces the same HTML output.

            Show
            Rex Lorenzo added a comment - I fixed the HTML for lists to make the embedded list as part of the parent list li tags and looks to be fixed now. When you try to make lists within lists via the HTML editor it produces the same HTML output.

              People

              • Votes:
                3 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: