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

Apply Display H5P filter inside <a> tags

    XMLWordPrintable

Details

    • MOODLE_38_STABLE, MOODLE_39_STABLE
    • MOODLE_39_STABLE
    • MDL-67337-master
    • Hide

      Prerequisites:

      • Having multiple H5P content URLs:
      • Go to admin -> plugins -> filters -> h5p and, in "Allowed sources", add this:

        https://moodle.h5p.com/content/[id]/embed
        

      • Check in Site administration > Plugins > Filters > Manage filters 'Display H5P' is enabled and applied before 'Convert URLs into links and images' and 'Activity names auto-linking' filters.

      Test URLs

      1. Check in Site administration > Plugins > Filters > Manage filters 'Convert URLs into links and images' filter is Disabled or, in case it is On, is ordered below H5P filter.
      2. Create a course C1.
      3. In course C1, add a Label anywhere.
      4. In the Label text Atto editor, copy and paste  the following text using the HTML/code view:

      <div>1.valid URL https://moodle.h5p.com/content/1290848995208939539/embed inside a paragraph</div>
      <div>2.another valid URL: https://moodle.h5p.com/content/1290848995208939539/embed</div>
      <div>3.non valid URL: https://moodle.org</div>
      <div>4.URL inside a link tag: <a href="https://moodle.h5p.com/content/1290848995208939539/embed">link</a></div>
      <div>5.URL inside a link text with a different hrf value: <a href="hello.html">https://moodle.h5p.com/content/1290848995208939539/embed</a></div>
      <div>6.URL inside a link tag with only URL: <a href="https://moodle.h5p.com/content/1290848995208939539/embed">https://moodle.h5p.com/content/1290848995208939539/embed</a></div>

      1. Confirm that the H5P contents of 1, 2 and 6 are displayed. (3 should'n be displayed because the URL doesn't match the pattern, so is not a valid URL; and 4 and 5 shouldn't be diplayed because link text and 'href' attribute are different.)

        Test private files:

      1. As an admin navigate to 'Private files'
      2. Create a folder with spaces in the name, e.g. "Folder with spaces".
      3. Upload 'arithmetic-quiz (1)' file to the folder
      4. Navigate to Dashboard. Add 'Private files' block to your Dashboard.
      5. Copy link address to 'arithmetic-quiz (1)' file
      6. In a course create a new label.
      7. Add link address to 'arithmetic-quiz (1)' file to 'Label text'
      8. Save and return to course.
      9. Make sure H5P content is rendered and working
      10. In the same course create a new label. 
      11. Add a new link using Atto editor 'Link' button.
      12. Paste address to 'arithmetic-quiz (1)' file and 'Create Link'
      13. Save and return to course.
      14. Confirm H5P content is displayed
      Show
      Prerequisites: Having multiple H5P content URLs: Go to admin -> plugins -> filters -> h5p and, in "Allowed sources", add this: https://moodle.h5p.com/content/[id]/embed Check in Site administration > Plugins > Filters > Manage filters 'Display H5P' is enabled and applied before 'Convert URLs into links and images' and 'Activity names auto-linking' filters. Test URLs Check in Site administration > Plugins > Filters > Manage filters 'Convert URLs into links and images' filter is Disabled or, in case it is On, is ordered below H5P filter. Create a course C1. In course C1, add a Label anywhere. In the Label text Atto editor, copy and paste  the following text using the HTML/code view : <div>1.valid URL https://moodle.h5p.com/content/1290848995208939539/embed inside a paragraph</div> <div>2.another valid URL: https://moodle.h5p.com/content/1290848995208939539/embed</div> <div>3.non valid URL: https://moodle.org</div> <div>4.URL inside a link tag: <a href="https://moodle.h5p.com/content/1290848995208939539/embed">link</a></div> <div>5.URL inside a link text with a different hrf value: <a href="hello.html">https://moodle.h5p.com/content/1290848995208939539/embed</a></div> <div>6.URL inside a link tag with only URL: <a href="https://moodle.h5p.com/content/1290848995208939539/embed">https://moodle.h5p.com/content/1290848995208939539/embed</a></div> Confirm that the H5P contents of 1, 2 and 6 are displayed. (3 should'n be displayed because the URL doesn't match the pattern, so is not a valid URL; and 4 and 5 shouldn't be diplayed because link text and 'href' attribute are different.) Test private files: As an admin navigate to 'Private files' Create a folder with spaces in the name, e.g. "Folder with spaces". Upload 'arithmetic-quiz (1)' file to the folder Navigate to Dashboard. Add 'Private files' block to your Dashboard. Copy link address to 'arithmetic-quiz (1)' file In a course create a new label. Add link address to 'arithmetic-quiz (1)' file to 'Label text' Save and return to course. Make sure H5P content is rendered and working In the same course create a new label.  Add a new link using Atto editor 'Link' button. Paste address to 'arithmetic-quiz (1)' file and 'Create Link' Save and return to course. Confirm H5P content is displayed

    Description

      As explained in MDL-66382 'Display H5P' filter is ignoring H5P URLs inside tags like <a href="xxx">

      But when somebody copy an H5P content URL from a Chrome browser address bar and paste it in Moodle rich text editor, is pasted as a link, inside <a> tags. So 'Display H5P' filter is not applied in those cases.

      'Convert URLs into links and images' filter is ignoring content inside tags as well, but 'Multimedia plugins' filter is not ignoring them. So maybe the best behavior for filters should be decided and implement it consistently all along Moodle filters.

       

      Attachments

        Activity

          People

            amaia Amaia Anabitarte
            amaia Amaia Anabitarte
            Carlos Escobedo Carlos Escobedo
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Anna Carissa Sadia Anna Carissa Sadia
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Raquel Ortega, Sara Arjona (@sarjona), Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Raquel Ortega, Sara Arjona (@sarjona)
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              15/Jun/20

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 days, 15 minutes
                3d 15m