簡體   English   中英

添加 unsplash 圖像時 rss feed 出現錯誤

[英]getting error in rss feed when adding unsplash image

我目前正在為我的網站創建一個 RSS 提要,並在我的博客文章中包含了 Unsplash 圖片。 但是,當我嘗試將這些圖像添加到 RSS 提要中時,

但我有一個錯誤

我的代碼

 <media:thumbnail url="https://images.unsplash.com/photo-1642665076339-ca50c80a44e7?
ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=2070&q=80"
 width="220"/>

但我得到了錯誤

錯誤

The reference to entity "ixid" must end with the ';' delimiter. xml(SemicolonRequiredInReference)

請建議我為什么會收到此錯誤

& 是HTML和XML中的一個特殊字符,如果想把它當作普通字符使用,就必須正確編碼。 寫 & 而不是 &:

 <media:thumbnail url="https://images.unsplash.com/photo-1642665076339-ca50c80a44e7?ixlib=rb-4.0.3&amp;ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&amp;auto=format&amp;fit=crop&amp;w=2070&amp;q=80"
 width="220"/>

& 表示編碼實體的開始,例如 < 代表 <,或 & 代表 &。 在您的情況下,解析器嘗試將 &w 解釋為實體。 但是實體總是由一個終止; 因此,如果; 缺少您會收到錯誤消息。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM