Skip to content

Commit 17aba74

Browse files
committed
Fix slugify.
1 parent a60c0db commit 17aba74

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/fields/core/fieldChecklist.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
5454
getInputName(item){
5555
if(this.schema && this.schema.inputName && this.schema.inputName.length > 0){
56-
return this.schema.inputName + "_" + this.getItemValue(item);
56+
return slugify(this.schema.inputName + "_" + this.getItemValue(item));
5757
}
5858
return slugify(this.getItemValue(item));
5959
},

src/utils/schema.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,11 @@ module.exports.slugify = function (name = "") {
8888
.trim()
8989
//.toLowerCase()
9090
// Spaces & underscores to dashes
91-
.replace(/ |_/g, "-")
91+
.replace(/ /g, "-")
9292
// Multiple dashes to one
9393
.replace(/-{2,}/g, "-")
9494
// Remove leading & trailing dashes
9595
.replace(/^-+|-+$/g, "")
9696
// Remove anything that isn't a (English/ASCII) letter, number or dash.
97-
.replace(/([^a-zA-Z0-9-]+)/g, "");
97+
.replace(/([^a-zA-Z0-9-_/./:]+)/g, "");
9898
};

0 commit comments

Comments
 (0)