NaturalIntelligence / NaturalIntelligence/fast-xml-parser
ignoreDeclaration does not ignore lower case doctype declaration
Open
Beginner friendly
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 3.1k
- Forks
- 395
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 1
Description
- Are you running the latest version?
- Have you included sample input, output, error, and expected output?
- Have you checked if you are using correct configuration?
- Did you try online tool?
- Have you checked the docs for helpful APIs and examples?
Description
ignoreDeclaration does not ignore lower case doctype declaration.
Input
Code
const html = `<!doctype html><html></html>`;
const parser = new XMLParser({
ignoreDeclaration: true,
});
let jObj = parser.parse(html);
console.log(jObj);
Output
{ '!doctype': { html: '' } }
expected data
{ html: '' }
Would you like to work on this issue?
- Yes
- No
Bookmark this repository for further updates. Visit SoloThought to know about recent features.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the provided JavaScript snippet with the XMLParser and ignoreDeclaration option, then inspect the parser's handling of doctype declarations. Confirm that lowercase <!doctype html> is treated consistently with the ignored declaration form. Done means the parsed result matches the expected { html: '' } output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100