Skip to content

HTML entities stripped from item title #243

Closed

Description

@autonome

Eg: ">"

I'm parsing https://groups.google.com/forum/feed/mozilla.dev.platform/topics/rss.xml?num=50

The item titled "Intent to unship: as in image maps" has those entities encoded as < and > respectively.

However, in the code example below, the entities are missing from item.title, as is detectable from the length:

let url = 'https://groups.google.com/forum/feed/mozilla.dev.platform/topics/rss.xml?num=50';
let req = request(url);
let feedparser = new FeedParser();

req.on('response', function (res) {
this.pipe(feedparser);
});

feedparser.on('readable', function() {
let item = this.read();
console.log(item.title.length)
}

Activity

  1. danmactough commented on Nov 23, 2017

    @danmactough
    Owner

    @autonome Thanks for opening this issue.

    This stripping is being done intentionally -- however, I can't actually remember why. 😬 Presumably, the idea was to avoid handing people a XSS injection foot-gun.

    Note that the un-stripped title is available: item['rss:title']['#'].

    { title: 'Intent to unship:  as  in image maps',
      description: 'Hi, In bug 1317937 I intend to unship the feature of <a> elements acting the same way as <area> elements in image maps. This functionality was specced in HTML 4, but no other browser implemented it and was removed from HTML 5. Timothy (:tnikkel) tried to do it before, but it got blocked on',
      summary: 'Hi, In bug 1317937 I intend to unship the feature of <a> elements acting the same way as <area> elements in image maps. This functionality was specced in HTML 4, but no other browser implemented it and was removed from HTML 5. Timothy (:tnikkel) tried to do it before, but it got blocked on',
      date: 2017-11-08T23:50:27.000Z,
      pubdate: 2017-11-08T23:50:27.000Z,
      pubDate: 2017-11-08T23:50:27.000Z,
      link: 'https://groups.google.com/d/msg/mozilla.dev.platform/JUB5K-sz6ek/F4hQWdDRBQAJ',
      guid: 'https://groups.google.com/d/topic/mozilla.dev.platform/JUB5K-sz6ek',
      author: 'Emilio Cobos Álvarez',
      comments: null,
      origlink: null,
      image: {},
      source: {},
      categories: [],
      enclosures: [],
      'rss:@': {},
      'rss:title':
       { '@': {},
         '#': 'Intent to unship: <a> as <area> in image maps' },
      'rss:link':
       { '@': {},
         '#': 'https://groups.google.com/d/msg/mozilla.dev.platform/JUB5K-sz6ek/F4hQWdDRBQAJ' },
      'rss:description':
    
  2. autonome commented on Nov 23, 2017

    @autonome
    Author
  3. self-assigned this
    on Dec 9, 2017
  4. danmactough commented on Dec 9, 2017

    @danmactough
    Owner

    related to #165

  5. autonome commented on Jan 4, 2018

    @autonome
    Author

    Wonderful, thanks @danmactough!

  6. danmactough commented on May 14, 2026

    @danmactough
    Owner

    Resolved by #304

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions