wbond / pybars3

Handlebars.js template support for Python 3 and 2
GNU Lesser General Public License v3.0
179 stars 46 forks source link

preventIndent option #58

Open mateuszkitlas opened 5 years ago

mateuszkitlas commented 5 years ago

As far as I understand the source code, there is no way to keep original indent. Current state is:

print(compiler.compile("aaa\n   {{value}}bbb\nccc")({'value': 'ddd1\nddd2'}))
aaa
   ddd1
ddd2bbb
ccc

and my goal is something like:

print(compiler.compile("aaa\n   {{value}}bbb\nccc", preventIndent=True)({'value': 'ddd1\nddd2'}))
aaa
   ddd1
   ddd2bbb
ccc

Are you planning to implement something like this? Or is it available now, but I just missed it?