Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions ical.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,20 +249,18 @@
i += 1
}

var kv = l.split(":")
var exp = /([^":;]+)((?:;(?:[^":;]+)(?:=(?:(?:"[^"]*")|(?:[^":;]+))))*):(.+)/;
var kv = l.match(exp);

if (kv.length < 2){
if (kv === null) {
// Invalid line - must have k&v
continue;
}
kv = kv.slice(1);

// Although the spec says that vals with colons should be quote wrapped
// in practise nobody does, so we assume further colons are part of the
// val
var value = kv.slice(1).join(":")
, kp = kv[0].split(";")
, name = kp[0]
, params = kp.slice(1)
var value = kv[kv.length - 1]
, name = kv[0]
, params = kv[1]?kv[1].split(';').slice(1):[]

ctx = self.handleObject(name, value, params, ctx, stack, l) || {}
}
Expand Down