How to add line breaks to event header in json

one thing that I can’t get directly is the ability to add html without escaping it or creating new lines

here is my json:

{ "id": 30, "title": "Basics \n Awesome Abs & Butt Blast \n Danielle B", "start": "2010-05-11T08:00:00-04:00", "end": "2010-05-11T08:30:00-04:00", "allDay": false } 

and here is the code for it:

 [ <% @events.each do |e| %> { "id": <%= e.id -%>, "title": "<p><%= e.event_template.level %></p><p><%= e.monqi_class.title %></p><p><%= e.instructor.last_initial %></p>", "start": "<%= e.start_date.iso8601 %>", "end": "<%= e.end_date.iso8601 %>", "allDay": false } <%= @events.last == e ? "" : "," %> <% end -%> ] 

so I try to have even 3 lines inside (level, class title and instructor)

the problem is that it escapes, so charcters are not processed by html

Can you help me with this?

thanks a lot

Ami

+4
source share
2 answers

Use a token to break the string, for example ~ or | , then replace it with <br /> on the output.

+3
source

discussion of the tracker problem on this topic. might help: http://code.google.com/p/fullcalendar/issues/detail?id=351

+3
source

Source: https://habr.com/ru/post/1309435/


All Articles