getRenderProperties doesn't recognize svg element
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 5.9k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
There is a bug in helper/getRenderProperties:
element && element.nodeName === 'svg'
This is caused by the fact browser can sometimes return nodeName UPPERCASE (see https://johnresig.com/blog/nodename-case-sensitivity/).
Therefore:
var element = document.createElementNS("http://www.w3.org/2000/svg", "svg");
JsBarcode(element, '123456789012', {format: "ean13"});
will work, but:
var element = document.createElement("svg");
JsBarcode(element, '123456789012', {format: "ean13"});
will throw an exception.
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
Read helper/getRenderProperties and compare its handling of the two SVG elements described in the issue. Verify that JsBarcode works with both document.createElementNS and document.createElement SVG elements without throwing an exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100