Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Diet template does not support soft tab indent #3

Closed
zhaopuming opened this issue Apr 27, 2012 · 4 comments
Closed

Diet template does not support soft tab indent #3

zhaopuming opened this issue Apr 27, 2012 · 4 comments
Assignees

Comments

@zhaopuming
Copy link

When using soft tab (2 spaces as a tab) with index.jd, like:

extends layout.jd
block body
  h1 Example page - Home
  p Hello, World!

vibe complains about

diet.d(137): Error: "Error in template index.jd line 3: Inside an extension template, only 'block' tags are allowed at root level.(diet.d:169)"

I think its because diet does not recognize soft tab as an indent and regards h1 Example ... as a new block, hence the error.

Should that be supported? I found that jade-lang.org are using soft tab in there examples

@s-ludwig
Copy link
Member

My idea was to avoid the problems you can get with mixed tabs/spaces by just allowing tabs. But you made me think that maybe detecting the type of indentation (tabs or N spaces) at the first indented line would be a good alternative. All following lines would then be forced to use the same indentation style.

@ghost ghost assigned s-ludwig Apr 27, 2012
@zhaopuming
Copy link
Author

Yes, detecting indentation by the first indented line, it's exactly what I wanted :) Python syntax does this too

@s-ludwig
Copy link
Member

This is now implemented with d7ac37b.

@simendsjo
Copy link
Contributor

diet.d(747): Error: cannot implicitly convert expression (cast(ulong)l / indent.length) of type ulong to int
Compiling diet template 'index.dt'...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants