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

count_words returns too few words when dealing with html tags

    XMLWordPrintable

Details

    Description

      The problem is strip_tags will join words together:

      <p>Some text</p>
      <p><br/><p>
      <p>Some more text</p>

      How many words ? Moodle thinks it's 4.

      Also count_letters includes the letters in HTML entities - eg &nbsp; is 6 letters.

      Attachments

        Issue Links

          Activity

            People

              timhunt Tim Hunt
              damyon Damyon Wiese
              Jason Platts Jason Platts
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              CiBoT CiBoT
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              3 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                8/Mar/21

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 45 minutes
                  45m