rowanmanning / rowanmanning/feed-parser

Entity expansion

Open
#220 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
49
Forks
8
Avg merge
2m
Merged PRs (30d)
2

Description

Hi Rowan!
I'm using feed-parser for my Feed Analyzer and someone complained that entities are not getting expanded properly. Feed with the issue. Based on my understanding of XML, this is a real issue.

I tested fast-xml-parser and it will correctly expand entities if you add htmlEntities: true to the options. The processEntities: true option didn't seem to do anything.

However, I noticed that there is also entity processing in element.js and I don't want double-expand them (though I'm not using textContentNormalized(), so it would work for me).

Let me know what you think. I'm happy to make a PR if you are okay with adding the option.
Andrew

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the entity behavior with the linked feed at chrismorgan.info/feed.xml and inspect the entity-processing code in lib/xml/element.js around line 214. Compare the parser's htmlEntities and processEntities options, taking care not to expand entities twice. Done means the feed's entities are expanded correctly without breaking textContentNormalized().

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.