From 01eb4f00a074ecbc39c21d0dac5cf8e109f29a7e Mon Sep 17 00:00:00 2001 From: Oskari Timperi Date: Fri, 21 Sep 2012 09:43:53 +0300 Subject: hopefully handles folded lines in the input --- src/ical.peg | 10 ++++++++-- 1 file 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 []; } -- cgit v1.2.3