描述和内容之间的区别:RSS2中的编码标签 [英] Difference between description and content:encoded tags in RSS2

查看:184
本文介绍了描述和内容之间的区别:RSS2中的编码标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

RSS 2.0格式规范中的<description>标记和<content:encoded>标记之间有什么区别(如果有)?

What is the difference, if any, between the <description> tag and the <content:encoded> tag in RSS 2.0 format specifications?

一个比另一个重要吗?

我应该同时在供稿中使用这两个供养吗?

Should I be using both in my feeds or one will suffice?

推荐答案

<description>标记用于发布摘要,但仅用于纯文本.没有标记.

The <description> tag is for the summary of the post, but in plain text only. No markup.

如果您逃脱了标签或将内容包装在以下内容中,则可以解决此问题:

You can get around that if you escape the tags or wrap the content in:

<![CDATA[ post body goes <strong>here</strong> ]>

但是您实际上不应该这样做.

如果要标记,则应使用<content:encoded>并在此处使用<![CDATA[]>包装器.

If you want markup, you're supposed to use <content:encoded> and use the <![CDATA[ and ]> wrappers here.

content:encoded元素可以与description元素结合使用,以提供项目的全部内容以及简短的摘要.在这种方法下,项目的完整文本显示在content:encoded中,摘要显示在description中.

The content:encoded element can be used in conjunction with the description element to provide an item's full content along with a shorter summary. Under this approach, the complete text of the item is presented in content:encoded and the summary in description.

简而言之,<description>用于摘要,其余内容在<content:encoded>.

In short, <description> is for the summary and the rest of the post is in <content:encoded>.

由于某些读者可能不支持预期的标签,因此您通常在<description>中看到整个文章,而不是两者的混合.

Since some readers may not support the tags as expected, you usually see the entire post in <description> and not a mix of the two.

这篇关于描述和内容之间的区别:RSS2中的编码标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆