From c913dd8364d95d1709bf8fd867dc4dea8c83423f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B8=D0=BB=D1=8F=D0=BD=20=D0=9F=D0=B0=D0=BB=D0=B0?= =?UTF-8?q?=D1=83=D0=B7=D0=BE=D0=B2?= Date: Tue, 29 Nov 2022 10:43:41 +0200 Subject: [PATCH] stringify: do not use unescapedIndexOf in property parameters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit … 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. https://github.com/kewisch/ical.js/pull/658 This supersedes https://github.com/kewisch/ical.js/pull/535 and updates https://github.com/kewisch/ical.js/pull/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 --- test/stringify_test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/stringify_test.js b/test/stringify_test.js index 48a6714f..1ffbf661 100644 --- a/test/stringify_test.js +++ b/test/stringify_test.js @@ -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');