SyndicationFeed: Content as CDATA?

前端 未结 9 2116
梦毁少年i
梦毁少年i 2021-01-13 16:17

I\'m using .NET\'s SyndicationFeed to create RSS and ATOM feeds. Unfortunately, I need HTML content in the description element (the Content property of the SyndicationItem)

9条回答
  •  南方客
    南方客 (楼主)
    2021-01-13 16:52

    For those for whom the solution provided by cpowers and WonderGrub also didn't work, you should check out the following SO question, because for me this question was actually the answer to my occurence of this problem! Rss20FeedFormatter Ignores TextSyndicationContent type for SyndicationItem.Summary

    Judging from the positive answer from thelsdj and Andy Rose and then later the 'negative' response from TimLeung and the alternative offered by WonderGrub I would estimate that the fix offered by cpowers stopped working in some later version of ASP.NET or something.

    In any case the solution in the above SO article (derived from David Whitney's code) solved the problem with unwanted HTML encoding in CDATA blocks in an RSS 2.0 feed for me. I used it in an ASP.NET 4.0 WebForms application.

提交回复
热议问题