Skip to content

Commit 62bb047

Browse files
authored
Merge pull request #85 from namoscato/fix-83
Fix property parsing
2 parents db75862 + 590c6a2 commit 62bb047

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/kafka-connect/configuration/editor/configuration-editor-properties.component.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858

5959
self.ngModelController.$parsers.push(function (value) {
6060
var config = {};
61+
var delimiterIndex;
6162
var line;
6263
var lines = value.match(/[^\r\n]+/g);
6364

@@ -69,13 +70,13 @@
6970
continue;
7071
}
7172

72-
line = line.split(PROPERTY_DELIMITER);
73+
delimiterIndex = line.indexOf(PROPERTY_DELIMITER);
7374

74-
if (2 !== line.length) {
75+
if (-1 === delimiterIndex) {
7576
return; // parse error
7677
}
7778

78-
config[line[0]] = line[1] || '';
79+
config[line.substr(0, delimiterIndex)] = line.substr(1 + delimiterIndex);
7980
}
8081

8182
return config;

0 commit comments

Comments
 (0)