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

    • MOODLE_34_STABLE, MOODLE_35_STABLE
    • MOODLE_34_STABLE, MOODLE_35_STABLE
    • wip-nolink-bug
    • 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.

      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.

       

            rabser Sergio Rabellino
            rabser Sergio Rabellino
            Jan Dageförde Jan Dageförde
            Jake Dallimore Jake Dallimore
            Anna Carissa Sadia Anna Carissa Sadia
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

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

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