Skip to content

Commit 285e0bb

Browse files
committed
Force disabling single-quote list for type parameter
Signed-off-by: John Molakvoæ <[email protected]>
1 parent 864deba commit 285e0bb

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

src/models/contact.js

+2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ import store from '../store'
2828
import updateDesignSet from '../services/updateDesignSet'
2929
import sanitizeSVG from '@mattkrick/sanitize-svg'
3030

31+
window.ICAL = ICAL
32+
3133
/**
3234
* Check if the given value is an empty array or an empty string
3335
*

src/services/updateDesignSet.js

+25
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,30 @@ const addGroupedProperties = vCard => {
6363
return madeChanges
6464
}
6565

66+
/**
67+
* Fixes misbehaviour with TYPE quotes and separated commas
68+
* Seems to have been introduced with https://github.com/mozilla-comm/ical.js/pull/387
69+
*
70+
* @returns {Boolean} Whether or not the design set has been altered.
71+
*/
72+
const setTypeMultiValueSeparateDQuote = () => {
73+
if (
74+
!ICAL.design.vcard.param.type
75+
|| ICAL.design.vcard.param.type.multiValueSeparateDQuote !== false
76+
|| !ICAL.design.vcard3.param.type
77+
|| ICAL.design.vcard3.param.type.multiValueSeparateDQuote !== false
78+
) {
79+
// https://github.com/mozilla-comm/ical.js/blob/ba8e2522ffd30ffbe65197a96a487689d6e6e9a1/lib/ical/stringify.js#L121
80+
ICAL.design.vcard.param.type.multiValueSeparateDQuote = false
81+
ICAL.design.vcard3.param.type.multiValueSeparateDQuote = false
82+
83+
return true
84+
}
85+
86+
return false
87+
}
88+
89+
/**
6690
/**
6791
* Check whether the ical.js design sets need updating (and if so, do it)
6892
*
@@ -72,6 +96,7 @@ const addGroupedProperties = vCard => {
7296
export default function(vCard) {
7397
let madeChanges = false
7498

99+
madeChanges |= setTypeMultiValueSeparateDQuote()
75100
madeChanges |= removePhoneNumberValueType()
76101
madeChanges |= addGroupedProperties(vCard)
77102

0 commit comments

Comments
 (0)