Need be more forgiving and lose Drop

99 views
Skip to first unread message

chad

unread,
Mar 21, 2012, 5:28:41 PM3/21/12
to dotliquid
I have 2 problems when using DotLiquid:

1. It's not very forgiving as far as white space is concerned. I have
a template with " -%}" at the end of line and it works as expected.
Well, when I miss the space before "-%}" or have an extra space after
"-%}", it stop working. Well, it took me quite a while to figure it
out. If you manually edit the template, such white space is very
likely.

2. I kind of understand the reasoning behind the base class "Drop".
But it is too much to ask if you have a bunch of existing classes you
want to use (especially if you are not the author of these classes).
Why not just give user options when choosing classes and properties?
(like Only Classes derived from Drop, decorated public/internal
classes, public properties/field, and so on...).

Alessandro Petrelli

unread,
Mar 22, 2012, 4:11:21 AM3/22/12
to dotl...@googlegroups.com
Hi Chad,
1. got it solved by changing line 231 of Template.cs with the following

source = Regex.Replace(source, string.Format(@"-({0}|{1})(\n|\r\n|[ \t]+)", Liquid.VariableEnd, Liquid.TagEnd), "$1");

I'm going to push it asap to GitHub.

2. there's already a pull request which could suite your needs, please check it here https://github.com/formosatek/dotliquid/pull/51 and cast your vote ;-)

AP
Reply all
Reply to author
Forward
0 new messages