calcom / cal.com

Scheduling infrastructure for absolutely everyone.

Home Page:https://cal.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[CAL-3713] Line breaks not reflecting in the event type description

milospuac opened this issue · comments

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:

  1. Add line breaks, styling, and/or markdown to event description
  2. [CAL-672] turn description into a multi-line field
  3. [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


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.