c3js / c3js/c3

replace "spaces" in generateTargetClass

Open
#2,723 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
9.3k
Forks
1.4k
Avg merge
6d 16h
Merged PRs (30d)
1

Description

Currently spaces are not replaces in `generateTargetClass `
```
ChartInternal.prototype.generateTargetClass = function (targetId) {
return targetId || targetId === 0 ? ('-' + targetId).replace(/\s/g, '-') : '';
};
```
I think `/\W+/g` would be better as it would also replace spaces.

```
ChartInternal.prototype.generateTargetClass = function (targetId) {
return targetId || targetId === 0 ? ('-' + targetId).replace(/\W+/g, '-') : '';
};
```
Am I missing s.th.?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.