From d35affa0fdc5ad1a722c1c59d3b14dd2ab4602a3 Mon Sep 17 00:00:00 2001 From: fcbsd Date: Wed, 1 Mar 2023 09:28:14 +0000 Subject: [PATCH] MDL-77365 count_words: Make span> an inline tag This commit merges the fix and test for the incorrect counting of words in essay type questions. The issue is due tags not being counted as inline tags. --- lib/moodlelib.php | 2 +- lib/tests/moodlelib_test.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/moodlelib.php b/lib/moodlelib.php index b329334a332..b77160cc373 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -8386,7 +8386,7 @@ function count_words($string) { | b> | del> | em> | i> | - ins> | s> | small> | + ins> | s> | small> | span> | strong> | sub> | sup> | u> ) \w+ # But, apart from those execptions, match any tag name. diff --git a/lib/tests/moodlelib_test.php b/lib/tests/moodlelib_test.php index f10155671b3..a808818672f 100644 --- a/lib/tests/moodlelib_test.php +++ b/lib/tests/moodlelib_test.php @@ -4003,6 +4003,7 @@ EOF; [2, "one\ftwo"], [1, "SO42-"], [6, '4+4=8 i.e. O(1) a,b,c,d I’m black&blue_really'], + [1, 'ab'], ]; }