SyndicationFeed: Content as CDATA?

前端 未结 9 2066
梦毁少年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:38

    The shortest way to do this is:

    .Content = SyndicationContent.CreateXhtmlContent("content]]>")
    

    That will be outputted in the XML as

    content]]>
    

    Not an elegant solution, I admit, but it works properly – just tried on a project of mine.

提交回复
热议问题