Skip to content

Commit

Permalink
stringify: do not use unescapedIndexOf in property parameters
Browse files Browse the repository at this point in the history
… as \ is no escape character there.  When the propery parameter
contains :, then it must be quoted, the colon cannot be escaped.

As the function stringify.propertyValue in fact stringifies
property parameter values, it is renamed accordingly.

kewisch#658

This supersedes kewisch#535
and updates kewisch#555 .

Without these changes, the herein added test fails:

1) ICAL.stringify
     stringify property
            stringify property value containing "escaped" ; , ::

    AssertionError: expected 'ATTENDEE;CN=X\::mailto:id' to equal 'ATTENDEE;CN="X\:":mailto:id'
        + expected - actual

    -ATTENDEE;CN=X\::mailto:id
        +ATTENDEE;CN="X\:":mailto:id
  • Loading branch information
dilyanpalauzov committed Apr 20, 2024
1 parent e43cf1c commit c913dd8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/stringify_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ suite('ICAL.stringify', function() {
delete ICAL.design.defaultSet.param.type;
});

test('stringify property value containing "escaped" semicolons, commas, colons', function() {
test('stringify property value containing "escaped" ; , :', function() {
let subject = new ICAL.Property('attendee');
subject.setParameter('cn', 'X\\:');
subject.setValue('mailto:id');
Expand Down

0 comments on commit c913dd8

Please sign in to comment.