d3plus-text
Advanced tools
Comparing version 1.2.3 to 1.2.4
@@ -9,6 +9,8 @@ // great unicode list: http://asecuritysite.com/coding/asc2 | ||
@param {String} value | ||
@param {String} [spacer = "-"] The character(s) to be used in place of spaces. | ||
*/ | ||
export default function (value) { | ||
return "".concat(value).replace(/[^A-Za-z0-9\-_]/g, function (_char) { | ||
if (_char === " ") return "-"; | ||
var spacer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "-"; | ||
return "".concat(value).replace(/[^A-Za-z0-9\-_\u0621-\u064A]/g, function (_char) { | ||
if (_char === " ") return spacer; | ||
var ret = false; | ||
@@ -15,0 +17,0 @@ for (var d = 0; d < diacritics.length; d++) { |
{ | ||
"name": "d3plus-text", | ||
"version": "1.2.3", | ||
"version": "1.2.4", | ||
"description": "A smart SVG text box with line wrapping and automatic font size scaling.", | ||
@@ -5,0 +5,0 @@ "main": "es/index.js", |
@@ -463,3 +463,3 @@ # d3plus-text | ||
<a name="strip"></a> | ||
#### d3plus.**strip**(value) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/strip.js#L18) | ||
#### d3plus.**strip**(value, [spacer]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/strip.js#L18) | ||
@@ -471,2 +471,8 @@ Removes all non ASCII characters from a string. | ||
| Param | Type | Default | Description | | ||
| --- | --- | --- | --- | | ||
| value | <code>String</code> | | | | ||
| [spacer] | <code>String</code> | <code>"-"</code> | The character(s) to be used in place of spaces. | | ||
--- | ||
@@ -646,2 +652,2 @@ | ||
###### <sub>Documentation generated on Tue, 07 Mar 2023 17:29:23 GMT</sub> | ||
###### <sub>Documentation generated on Tue, 07 Nov 2023 14:33:30 GMT</sub> |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
626152
8667
651