开发者

How to avoid Velocity codes causing whitespaces?

开发者 https://www.devze.com 2023-03-01 16:33 出处:网络
I\'m using velocity template in dotCMS template files. One problem I noticed is that velocity adds whitespaces in html source code.

I'm using velocity template in dotCMS template files.

One problem I noticed is that velocity adds whitespaces in html source code.

Let's say I have the following source 开发者_开发知识库code.

#set($test = "aa")
#set($test2 = "aa")
<html>
<head>
...

when I execute the file and view source, I see the following. Basically, The first two lines are blank. How do I avoid it?

---- File Begin ---


<html>
<head>
...

---- File End ----


Velocity has never output whitespace from lines that have only a #set directive on them. Are you sure the blank lines are coming from those #set lines? Other Velocity directives are less consistent about handling whitespace, but #set is pretty clear.

0

精彩评论

暂无评论...
验证码 换一张
取 消