Adding HTML to the Description field in the Ticket Fields Widget

Community Alums
Not applicable

Does anyone know how to make the Description field in the Ticket Fields widget into HTML? I've seen some posts to use the $sce and bind HTML but not sure how to incorporate that into the widget code.

Thanks,

Aryanos

1 ACCEPTED SOLUTION

Okay got your point. Its not like the widget is not rendering the description as HTML. Actually in description you are getting \n as new line character while you need <br /> for html. Try to replace all \n with <br /> and it should work fine. Simply replace below line in code.

data.description = gr.description.getHTMLValue().replace(/\n/g,'<br />'); ;

 

 

View solution in original post

12 REPLIES 12

Community Alums
Not applicable

Hi Gurpreet,

I want to show the breaks in the text. Below is what you see when you view the record. Hope that helps.

find_real_file.png

 

Okay got your point. Its not like the widget is not rendering the description as HTML. Actually in description you are getting \n as new line character while you need <br /> for html. Try to replace all \n with <br /> and it should work fine. Simply replace below line in code.

data.description = gr.description.getHTMLValue().replace(/\n/g,'<br />'); ;

 

 

Community Alums
Not applicable

Hi Gurpreet,

Perfect that worked! I apologize in not being clearer with my requirements and thanks for taking the time to help me solve this.

Aryanos