13.4 文本解析器级别注释块:移除代码

类似于原型注释块,三种文本模版模式(TEXTJAVASCRIPTCSS)都能够通知Thymeleaf移除特别的/*[- *//* -]*/标记之间的代码,就像这样:

  1. var x = 23;
  2. /*[- */
  3. var msg = "This is shown only when executed statically!";
  4. /* -]*/
  5. var f = function() {
  6. ...

或者这样,在TEXT模式:

  1. ...
  2. /*[- Note the user is obtained from the session, which must exist -]*/
  3. Welcome [(${session.user.name})]!
  4. ...