显示编码的HTML标记的Drupal Feeds(Drupal Feeds showing encoded HTML markup)

编程入门 行业动态 更新时间:2024-10-24 06:34:25
显示编码的HTML标记的Drupal Feeds(Drupal Feeds showing encoded HTML markup)

无法弄清楚为什么会发生这种情况,但我的RSS提要在描述字段中显示了我需要摆脱的HTML编码:

例如:

<description>&lt;div class=&quot;field field-type-text field-field-location&quot;&gt;

我无法弄清楚为什么会发生这种情况。

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>&lt;div class=&quot;field field-type-text field-field-location&quot;&gt;

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.)

更多推荐

本文发布于:2023-04-27 23:16:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1329078.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:标记   Drupal   HTML   Feeds   markup

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!