-
Notifications
You must be signed in to change notification settings - Fork 2k
After precompilation, templates insert extra spacing #508
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
Comments
I found the issue (sort of) and a true workaround: There is a control character inserted at the head of the template result string. I don't know why, but it's there. For example, in my test case I would expect a string:
I would expect the length of this to be 19; 17 chars, plus \r\n. However, the length is actually 20, and the first '<' is at index 1, rather than 0.
I'll look into forking the code and fixing it properly. |
What does your source file look like if you open it in a hex editor? My first guess would be that your editor inserted a byte order mark. |
I don't think that we want to start altering the content that is passed to us as there are use cases where control characters that the user might want. Closing as this is something that should be handled on a case by case basis although I'm open to a PR that adds a flag to filter this in the bundled command line app if done as a conditional and in a generic manner. |
if Script tag is corrupted then also its added a new Line space |
I have a couple of test templates -- "header" and "body". They contain just a div and some text, and are rendered inside regions labeled "header-region" and "body1-region":
That's fine, but when I use the precompiled version of the templates, I see extra spacing inserted, throwing off my layout:

The text was updated successfully, but these errors were encountered: