简体   繁体   English

html标签到ical标签的格式

[英]html tags to ical tags formatting

How to transform html formatting tags, such as <b> , <i> , etc. for iCal so text would look like in html? 如何为iCal转换html格式标记(例如<b><i>等),以便文本在html中看起来像? I just found for new line, but would be grateful for any information about formatting tags. 我刚刚找到了新行,但是对于有关格式化标签的任何信息将不胜感激。

The only place you want to put HTML in an icalendar is in the X-ALT-DESC. 您想要将HTML放入icalendar的唯一位置是X-ALT-DESC。 There's no special encoding needed because angle brackets have no special meaning in icalendar. 不需要特殊的编码,因为尖括号在icalendar中没有特殊含义。 You just need to be careful with line breaks. 您只需要注意换行符。 You need to wrap your HTML to no more than 75 characters, and wrapped lines need to start with a space. 您需要将HTML包装为不超过75个字符,并且包装的行必须以空格开头。 You have a limited subset of HTML to play with. 您只能使用有限的HTML子集。 No scripts, and styles need to be defined as element attributes. 无需脚本,样式需要定义为元素属性。 So the full field would look like this... 所以整个字段看起来像这样...

X-ALT-DESC;FMTTYPE=text/html:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//E
 N">\n<html>\n<body>\n<table border="1"><tr><td>\n<b>HTML</b> Description o
 f event added to feed\n</td></tr><tr><td>\n<ul><li>HTML has certain advantages
 </li></ul>\n</td></tr></table>\n</body>\n</html>

Probably only way to do this is "Binary Content" - look at iCal format specyfication: 可能唯一的方法是“二进制内容”-查看iCal格式说明:

https://www.ietf.org/rfc/rfc2445.txt https://www.ietf.org/rfc/rfc2445.txt

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM