-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
4.1.10, 4.2.7, 4.3.4, 4.4
-
MOODLE_401_STABLE, MOODLE_402_STABLE, MOODLE_403_STABLE, MOODLE_404_STABLE
In Moodle, filters can be configured to apply to just main content ('Content' option on the managed filters page - leading to them being used during format_text calls) or to 'Content and headings' (leading to them being applied in both format_string and format_text).
However, some filters are guaranteed to do nothing when called from format_string. For example:
- filter_emoticon - https://github.com/moodle/moodle/blob/main/filter/emoticon/filter.php#L61
- filter_urltolink - https://github.com/moodle/moodle/blob/main/filter/urltolink/filter.php#L48
Therefore, it is terrible usability to let admins select this option.
A possible solution might be:
- Each filter class should have a method like public static can_apply_to_headings(): bool (can default to true in the base class)
- Manage filters admin page should check that, and only offer the 'Content and headings' option for filters that can support it.
This was found while testing MDL-78662.
- Discovered while testing
-
MDL-78662 Allow filtered content in answers for Drag-and-drop questions
-
- Closed
-