4

我无法弄清楚的一件事是能够添加 html 而不会被转义或实际创建新行

这是我的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
}

这是它的代码:

[
  <% @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 -%>
]

所以我试图在 3 行之内,(级别、班级名称和讲师)

问题是它被转义了所以字符没有被html解析

你能帮帮我吗?

非常感谢

阿米

4

2 回答 2

3

关于此主题的问题跟踪器的讨论。可能有帮助: http ://code.google.com/p/fullcalendar/issues/detail?id=351

于 2010-05-17T00:26:26.910 回答
3

使用标记作为换行符,例如~or |,然后在输出中将其替换为<br />

于 2010-05-11T15:27:04.990 回答