Skip to content

Commit

Permalink
Correctly parse double quoted property parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Adamczyk Błażej authored and kewisch committed Apr 13, 2024
1 parent 3553349 commit 9971651
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/ical/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,9 @@ parse._parseParameters = function(line, start, designSet) {
}
value = line.slice(valuePos, pos);
lastParam = unescapedIndexOf(line, PARAM_DELIMITER, pos);
if (lastParam === -1) {
let propValuePos = unescapedIndexOf(line, VALUE_DELIMITER, pos);
// if either no next parameter or delimeter in property value, let's stop here
if (lastParam === -1 || (propValuePos !== -1 && lastParam > propValuePos)) {
pos = false;
}
} else {
Expand Down
12 changes: 12 additions & 0 deletions test/parse_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,18 @@ suite('parserv2', function() {
expected
);
});

test('with quoted value', function() {
let input = ';FMTTYPE="text/html":Here is HTML with signs like =;';
let expected = {
'fmttype': 'text/html'
};

assert.deepEqual(
subject._parseParameters(input, 0, ICAL.design.components.vevent)[0],
expected
);
});
});

test('#_parseMultiValue', function() {
Expand Down

0 comments on commit 9971651

Please sign in to comment.