Add option to preserve newlines and non-breaking spaces

Created on 18 May 2022, about 2 years ago
Updated 13 February 2024, 5 months ago

Problem/Motivation

The "Body" field in Add to calendar exports is currently designed to remove newlines and non-breaking spaces. In scenarios where information like Zoom information is included, the text becomes difficult to read.

Example

Create event and in body put:

Join Zoom Meeting
https://yavapai.zoom.us/j/92492356480?pwd=SldrR1FxRnRRT211ODFKWFhjbWlPUT09

Meeting ID: 924 9235 6480
Passcode: xxxxxx
One tap mobile
+16699006833,,92492356480# US (San Jose)
+12532158782,,92492356480# US (Tacoma)

Dial by your location
        +1 669 900 6833 US (San Jose)
        +1 253 215 8782 US (Tacoma)
        +1 346 248 7799 US (Houston)
        +1 646 558 8656 US (New York)
        +1 301 715 8592 US (Washington DC)
        +1 312 626 6799 US (Chicago)
Meeting ID: 924 9235 6480

Resulting output:

Join Zoom Meeting https://yavapai.zoom.us/j/92492356480?pwd=SldrR1FxRnRRT211ODFKWFhjbWlPUT09 Meeting ID: 924 9235 6480 Passcode: xxxxxx One tap mobile +16699006833,,92492356480

Proposed resolution

Include formatting information.
Add a new formatter option to "Preserve line breaks," allowing sites to opt in to this behavior.

Remaining tasks

1. Update the Date Augmenter plugin form in src/Plugin/DateAugmenter/AddToCal.php to provide the new form checkbox.
2. Update the buildLinks() method to check if this option is selected, and if so, update the output of the $description value for all outputs (Google Calendar, Outlook, generic ICS) to retain line breaks.
3. Update test coverage to demonstrate this option works.

User interface changes

On viewing the field formatter for a date field that is eligible for using the date augmenter, a new checkbox option, "Preserve line breaks," is present.

API changes

None

Data model changes

- Update config/schema/addtocal_augment.schema.yml to reflect the new configuration option

✨ Feature request
Status

Fixed

Version

1.1

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States chanelwheeler

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024