Add CDATA tags at description field on D8

Created on 6 September 2019, about 6 years ago
Updated 19 June 2023, over 2 years ago

I tried to add <!CDATA[[ ]]> at the <description> field on a Drupal 8 rss view but failed.

I tried adding them on Twig template files, on Views RSS module and the Views core module. Also directly on the rss view, on Body field at the override output of field. All with no success.

Any ideas? Has anyone managed it on D8? I can see that at D7 there is a patch who solves it.

πŸ’¬ Support request
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡¬πŸ‡·Greece ggiakoumidakis

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • #11 solution just works for preview mode and debug mode, when I changed twig debud mode to false in `development.services.yml` file. Description does not contain `` anymore

    parameters:
      twig.config:
        debug: false
    
  • Status changed to Active over 2 years ago
  • πŸ‡ΊπŸ‡ΈUnited States damienmckenna NH, USA

    Can you please test the current release and let me know if the problem persists?

  • Status changed to Closed: duplicate almost 2 years ago
  • πŸ‡ΊπŸ‡ΈUnited States damienmckenna NH, USA

    I ended up making this change in πŸ› RSS output is no longer valid XML Fixed , the problem came up for me because of some changes in core, I think around core's output in 10.2 being HTML 5 while RSS needs to be XHTML.

  • Status changed to Active about 1 month ago
  • πŸ‡ΊπŸ‡ΈUnited States loze Los Angeles

    I realize this is an old post, but I am seeing exactly what described in #11 and #12 in the latest 8.x-2.4 release, so I am reopening it.

    with debug: true
    views UI preview has CDATA on the description tags
    front end has CDATA on the description tags

    with debug: false
    views UI preview has CDATA on the description tags
    front end DOES NOT have CDATA on the description tags

    I don't have any template or preprocess overrides for views_rss

    I'm using Drupal 10.5

Production build 0.71.5 2024