[CAL-3713] Line breaks not reflecting in the event type description
milospuac opened this issue · comments
From SyncLinear.com | CAL-3713
To address the issue with line breaks not displaying correctly in the event type descriptions, it's likely related to how the descriptionAsSafeHTML
property processes line breaks. This property should convert line breaks (\n
) into <br>
tags for them to render correctly in HTML. Here's a code snippet to help with this conversion:
function convertLineBreaksToHTML(inputText: string): string {
return inputText.replace(/\n/g, '<br>');
}
You can use this function to ensure line breaks in your event type descriptions are correctly converted before setting the descriptionAsSafeHTML
property. This approach will help maintain the intended formatting in the browser.
Additionally, reviewing similar past issues might offer further insights or solutions:
- Add line breaks, styling, and/or markdown to event description
- [CAL-672] turn description into a multi-line field
- [CAL-816] event type description: line break not applied on booking page
These references could provide valuable context or alternative approaches to solving your problem. If you need more assistance or have other questions, feel free to ask.
Details
Sources
- Add line breaks, styling, and/or markdown to event description
- [CAL-672] turn description into a multi-line field
- [CAL-816] event type description: line break not applied on booking page
- apps/web/components/eventtype/EventTypeDescriptionSafeHTML.tsx
- packages/emails/src/components/Info.tsx
- packages/lib/turndownService.ts
- packages/lib/event-types/getEventTypesPublic.ts
About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
To continue the conversation, mention @dosu.