Permalink
Browse files

""

git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk/yaws@44 9fbdc01b-0d2c-0410-bfb7-fb27d70d8b52
  • Loading branch information...
klacke committed Mar 24, 2002
1 parent d348051 commit 39c94ab94e0f9e2127ca590c1734aad7ac3a3023
Showing with 7 additions and 2 deletions.
  1. +7 −2 src/yaws_compile.erl
View
@@ -61,15 +61,20 @@ compile_file(C, LineNo, eof, Mode, NumChars, Ack) ->
{ok, lists:reverse([{data, NumChars} |Ack])};
-%% skip initial space
+%% skip initial space if first thing is <erl> otherwise not
compile_file(C, LineNo, Chars, init, NumChars, Ack) ->
case Chars -- [$\s, $\t, $\n, $\r] of
[] ->
?Debug("SKIP ~p~n", [Chars]),
L=length(Chars),
compile_file(C, LineNo+1, line(C), init, NumChars-L, Ack);
+ "<erl>" ++ _ -> %% first chunk is erl, skip whistespace
+ compile_file(C, LineNo, Chars, html, NumChars, Ack);
_ ->
- compile_file(C, LineNo, Chars, html, NumChars, Ack)
+ %% first chunk is html, keep whitespace
+ Fd=C#comp.infd,
+ file:position(Fd, bof),
+ compile_file(C,1,io:get_line(Fd,''),html,0,[])
end;
compile_file(C, LineNo, Chars = "<erl>" ++ Tail, html, NumChars, Ack) ->

0 comments on commit 39c94ab

Please sign in to comment.