我正在尝试从我的网络应用程序在谷歌日历中插入事件的描述,但我无法获得\n 或 <br />
被解释为换行符。谷歌日历如何解释换行符?帮助将不胜感激!
最佳答案
您是否使用特定的客户端库?如果使用该协议(protocol),只需在内容元素中添加换行符即可:
<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="http://www.w3.org/2005/Atom"
xmlns:gCal="http://schemas.google.com/gCal/2005"
xmlns:gd="http://schemas.google.com/g/2005">
<title type="text">Event with new line</title>
<content type="text">This is an event with one
two
three
and and four lines.</content>
<gd:when endTime="2011-12-23T10:00:00.000-07:00"
startTime="2011-12-23T08:00:00.000-07:00"/>
</entry>
如果使用客户端库,使用 '\n' 应该也可以。
关于google-api - Google Calendar Api 的换行符?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7830582/