无法弄清楚为什么会发生这种情况,但我的RSS提要在描述字段中显示了我需要摆脱的HTML编码:
例如:
<description><div class="field field-type-text field-field-location">我无法弄清楚为什么会发生这种情况。
Can't figure out why this is happening, but my RSS feeds are showing HTML encoding in the description field that I need to get rid of:
For example:
<description><div class="field field-type-text field-field-location">I just can't figure out why this would be happening.
最满意答案
这是正确的。 <description>的内容应该是 XML文本编码的HTML。 至少对于RSS 2.0; 其他版本的RSS在这个问题上出了名并不一致,并且非常愚蠢。
(如果它没有被编码,那么只有格式良好且名称空间的XHTML才能进入元素。这种方法没有被采用,主要是因为RSS早于XHTML。)
That's correct. The content of <description> is supposed to be XML-text-encoded HTML. At least for RSS 2.0; other versions of RSS are notoriously inconsistent and woolly on this matter.
(If it weren't encoded, then only well-formed and namespaced XHTML could go in the element. This approach was not taken, primarily because RSS predates XHTML.)
更多推荐
发布评论