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

Tag <span class="nolink"> ignored by glossary autolinking when are present other attributes, like style

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.4, 3.5.1
    • Fix Version/s: 3.4.4, 3.5.1
    • Component/s: Glossary
    • Labels:
    • Testing Instructions:
      Hide
      1. Create a glossary in a course and make sure the autolink is enabled - it should be by default.
      2. Insert a glossary entry for the item "TESTWORD"
      3. Make sure the glossary autolink filter is enabled at site level. (Admin -> Plugins -> Manage filters)
      4. Insert a page with the html content set to

        <span style="color:red" class="nolink">TESTWORD</span><br><br>
        <span class="nolink" style="color:red">TESTWORD</span><br><br>
        <span class="otherclass">TESTWORD</span>
        

        Note: you will need to expand the Atto editor using the top left button, titled 'Show advanced', and then click the 'Html' icon, bottom right.

      5. Verify that the text is NOT linked to the glossary entry in the first 2 cases and that it IS in the last case.
      Show
      Create a glossary in a course and make sure the autolink is enabled - it should be by default. Insert a glossary entry for the item "TESTWORD" Make sure the glossary autolink filter is enabled at site level. (Admin -> Plugins -> Manage filters) Insert a page with the html content set to <span style="color:red" class="nolink">TESTWORD</span><br><br> <span class="nolink" style="color:red">TESTWORD</span><br><br> <span class="otherclass">TESTWORD</span> Note: you will need to expand the Atto editor using the top left button, titled 'Show advanced', and then click the 'Html' icon, bottom right. Verify   that the text is NOT linked to the glossary entry in the first 2 cases and that it IS in the last case.
    • Affected Branches:
      MOODLE_34_STABLE, MOODLE_35_STABLE
    • Fixed Branches:
      MOODLE_34_STABLE, MOODLE_35_STABLE
    • Pull 3.5 Branch:
      wip-nolink-bug-35
    • Pull Master Branch:
      wip-nolink-bug

      Description

      It can happens that the <span class="nolink"> inserted by the HTML editor is changed adding some other attributes, like the style one:

      <span style="color:red;" class="nolink">SOME WORDS</span>

      This should be the output of a re-edit of a page or some contents or heading of a resource, when the user apply the nolink to a styled paragraph or applying the style to a nolink span.

      In this case the nolink is ignored and the words inside the span are linked to the glossary, despite of the nolink definition.

      I found that modifying the search pattern into lib/filterlib.php this can easily solved and the small changes are here:

      https://gitlab.di.unito.it/rabellino/moodle/tree/wip-nolink-bug

       

      Hope this helps.

       

        Attachments

          Activity

            People

            Assignee:
            rabser Sergio Rabellino
            Reporter:
            rabser Sergio Rabellino
            Peer reviewer:
            Jan Dageförde
            Integrator:
            Jake Dallimore
            Tester:
            Anna Carissa Sadia
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              9/Jul/18

                Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 30 minutes
                30m