badges / badges/shields

DOMParser for dynamic xml badge spews log results in production

Open
#2,658 0 comments 0 reactions 0 assignees View on GitHub
good first issue service-badge
Dominant language
JavaScript
Stars
27.2k
Forks
5.6k
Avg merge
1d 8h
Merged PRs (30d)
46

Description

e.g.

```
@#[line:21,col:1]
[xmldom warning] unclosed xml attribute
@#[line:22,col:1]
[xmldom warning] unclosed xml attribute
@#[line:23,col:1]
[xmldom warning] unclosed xml attribute
@#[line:24,col:1]
[xmldom error] element parse error: Error: attribute value must after "="
@#[line:47,col:85]
[xmldom error] element parse error: Error: invalid tagName:\
@#[line:47,col:232]
[xmldom warning] unclosed xml attribute
@#[line:154,col:7]
[xmldom error] entity not found: 
@#[line:212,col:143]
[xmldom error] entity not found: 
@#[line:212,col:143]
[xmldom warning] unclosed xml attribute
@#[line:299,col:31]
[xmldom warning] attribute "selected" missed value!! "selected" instead!!
@#[line:342,col:14]
[xmldom error] entity not found: 
@#[line:379,col:57]
[xmldom error] entity not found: 
```

I imagine DOMParser is printing warnings by default. They have a way to provide our own error handler. Maybe we can use that to suppress these messages.

https://github.com/jindw/xmldom#api-reference

Contributor guide

Open the contributing guide

Research direction

Start by locating the dynamic XML badge code that uses DOMParser and review the xmldom API reference linked in the issue, especially its error-handler option. Reproduce the logged warnings with the reported badge input; done means malformed XML no longer spews parser messages into production logs while badge parsing still behaves as expected.

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
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.