diff options
| author | Oskari Timperi <oskari.timperi@iki.fi> | 2012-09-21 09:43:53 +0300 |
|---|---|---|
| committer | Oskari Timperi <oskari.timperi@iki.fi> | 2012-09-21 09:43:53 +0300 |
| commit | 01eb4f00a074ecbc39c21d0dac5cf8e109f29a7e (patch) | |
| tree | ac6412c8e9269d2b6ca8d781c73f2fef0a6fe1e1 | |
| parent | f09e684abaf6fa61c9dd78d83d4a111cf2708f07 (diff) | |
| download | calendar-01eb4f00a074ecbc39c21d0dac5cf8e109f29a7e.tar.gz calendar-01eb4f00a074ecbc39c21d0dac5cf8e109f29a7e.zip | |
hopefully handles folded lines in the input
| -rw-r--r-- | src/ical.peg | 10 |
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 []; } |
