Allow more day separators, next to line breaks

Created on 25 July 2023, over 1 year ago
Updated 24 August 2023, about 1 year ago

Problem/Motivation

The latest release of the module (8.x-1.11) added issue #3366646 🐛 Better days separator Fixed which adds am Xss filter to the day separators in the default office hours formatter (which is good), however it also limits the tags to only allow <br> tags.

If you are using any other HTML element to separate your days, they will be stripped out of the rendered list when upgrading to this version.

This is the commit that limits it: https://git.drupalcode.org/project/office_hours/-/commit/7c575d8c818a4f0...

Steps to reproduce

  1. Set up an office hours field with multiple days on a page,
  2. Customize the display of the field by adding an <hr> as the day separator,
  3. View the page. An empty span will use used as the day separator with no other tags inside.

Proposed resolution

I know this is supposed to be a plain text formatter, but maybe there should be a basic list of tags allowed. <br>, <hr>, <span>, and <div> perhaps?

Alternatively, if <br>s are the only tag allowed, that should be reflected in the description of the field. The day separator currently suggests using a <br> to separate lines, but does not say no other HTML tags are allowed.

🐛 Bug report
Status

Fixed

Version

1.11

Component

Code

Created by

🇨🇦Canada nickdjm

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024