aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOskari Timperi <oskari.timperi@iki.fi>2012-09-21 09:43:53 +0300
committerOskari Timperi <oskari.timperi@iki.fi>2012-09-21 09:43:53 +0300
commit01eb4f00a074ecbc39c21d0dac5cf8e109f29a7e (patch)
treeac6412c8e9269d2b6ca8d781c73f2fef0a6fe1e1
parentf09e684abaf6fa61c9dd78d83d4a111cf2708f07 (diff)
downloadcalendar-01eb4f00a074ecbc39c21d0dac5cf8e109f29a7e.tar.gz
calendar-01eb4f00a074ecbc39c21d0dac5cf8e109f29a7e.zip
hopefully handles folded lines in the input
-rw-r--r--src/ical.peg10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/ical.peg b/src/ical.peg
index 5ce3800..771ea44 100644
--- a/src/ical.peg
+++ b/src/ical.peg
@@ -1,9 +1,15 @@
/*
* PEG.js grammar for iCal (http://tools.ietf.org/html/rfc5545).
- * Does not understand folds. They must be taken care of before
- * using the parser generated from this grammar.
*/
+{
+    var foldRe = /[\n][ \t]/g;
+    
+    while (foldRe.test(input)) {
+        input = input.replace(foldRe, '');
+    }
+}
+
start
= ContentLineList
/ "" { return []; }