Uploaded image for project: 'Moodle app'
  1. Moodle app
  2. MOBILE-4617

Improve icon detection in grades

XMLWordPrintable

    • MOODLE_404_STABLE

      Right now in grades we have some code to detect if the grade contains an icon, and we remove the icon in that case:

      if (content.includes('fa-check')) {
          ...
          content = CoreTextUtils.cleanTags(content);
      } else if (content.includes('fa-times') || content.includes('fa-xmark')) {
          ...
          content = CoreTextUtils.cleanTags(content);
      }

      However, we found a site that uses material icons instead of font awesome (we believe the theme is doing this). The icon isn't rendered because we don't have those icons in the app, but the icon has some content text that is displayed in the app. This is some of the HTML we receive:

      <i class="icon material-icons inline cancel" title="Suspenso" role="img" aria-label="Suspenso">cancel</i>

      <i class="icon material-icons icon itemicon calculate" title="Calificación calculada" role="img" aria-label="Calificación calculada">calculate</i>

      In this same site, we also receive an icon in the itemname content, and in this case we always clean the HTML (we don't check if it contains icons). But our cleanTags function only removes the HTML tags, not the content, so we end up displaying some text that we shouldn't display. E.g. in the examples above we would display "cancel" and "calculate".

      We need to decide if we want to handle this only for grades, or we want to improve our cleanTags function to remove all text inside icons too.

            Unassigned Unassigned
            dpalou Dani Palou
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

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