Browse Source

fixes #240: introduce newlines in custom tag test.

Andreas Stenius 9 years ago
parent
commit
ea9f0dd723
3 changed files with 16 additions and 2 deletions
  1. 7 1
      src/erlydtl_scanner.erl
  2. 3 0
      src/erlydtl_scanner.slex
  3. 6 1
      test/files/input/custom_tag

+ 7 - 1
src/erlydtl_scanner.erl

@@ -36,7 +36,7 @@
 %%%-------------------------------------------------------------------
 -module(erlydtl_scanner).
 
-%% This file was generated 2015-10-17 21:30:29 UTC by slex 0.2.1-2-g7814678.
+%% This file was generated 2016-05-28 20:22:41 UTC by slex 0.2.1-2-g7814678.
 %% http://github.com/erlydtl/slex
 -slex_source(["src/erlydtl_scanner.slex"]).
 
@@ -479,6 +479,12 @@ scan("_(" ++ T, S, {R, C} = P, {_, E}) ->
 	 {R, C + 2}, {in_code, E});
 scan(" " ++ T, S, {R, C}, {_, E}) ->
     scan(T, S, {R, C + 1}, {in_code, E});
+scan("\r" ++ T, S, {R, C}, {_, E}) ->
+    scan(T, S, {R, C + 1}, {in_code, E});
+scan("\n" ++ T, S, {R, C}, {_, E}) ->
+    scan(T, S, {R + 1, 1}, {in_code, E});
+scan("\t" ++ T, S, {R, C}, {_, E}) ->
+    scan(T, S, {R, C + 1}, {in_code, E});
 scan([H | T], S, {R, C} = P, {in_code, E})
     when H >= $a andalso H =< $z orelse
 	   H >= $A andalso H =< $Z orelse H == $_ ->

+ 3 - 0
src/erlydtl_scanner.slex

@@ -217,6 +217,9 @@ end.
 %% note that `any' here will match states *with* a closer, i.e. not `in_text'.
 %% (`any-' would match any stateless state.)
 110 \s any: skip, in_code.
+111 \r any: skip, in_code.
+112 \n any: skip, in_code.
+113 \t any: skip, in_code.
 
 120 any in_code,
   expr \

+ 6 - 1
test/files/input/custom_tag

@@ -6,7 +6,12 @@
   </head>
   <body>
 	before
-	{% flashvideo dom_id="myvideo" width="800" height="600" static="/static" path_to_video="/myvid.mp4" path_to_preview_image="/mypic.jpg" alt=_("Get Adobe Flash player") %}
+	{% flashvideo
+           dom_id="myvideo" width="800" height="600"
+           static="/static" path_to_video="/myvid.mp4"
+           path_to_preview_image="/mypic.jpg"
+           alt=_("Get Adobe Flash player")
+        %}
 	after
   </body>
 </html>