diff options
author | Peter Andersson <[email protected]> | 2016-03-09 14:11:30 +0100 |
---|---|---|
committer | Peter Andersson <[email protected]> | 2016-03-09 17:12:49 +0100 |
commit | 52cee865fd9e5b4a1371c82075375a92b8f03fbe (patch) | |
tree | 7e1e8391e914eb093eab32fd6645e4d8f89e3101 /lib/test_server/src/test_server_gl.erl | |
parent | fb44a4de532ae97b3424078577dee7370078dea0 (diff) | |
download | otp-52cee865fd9e5b4a1371c82075375a92b8f03fbe.tar.gz otp-52cee865fd9e5b4a1371c82075375a92b8f03fbe.tar.bz2 otp-52cee865fd9e5b4a1371c82075375a92b8f03fbe.zip |
Fix minor issues with escaping characters
OTP-13003
Diffstat (limited to 'lib/test_server/src/test_server_gl.erl')
-rw-r--r-- | lib/test_server/src/test_server_gl.erl | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/lib/test_server/src/test_server_gl.erl b/lib/test_server/src/test_server_gl.erl index 6abc68db54..0acc73047c 100644 --- a/lib/test_server/src/test_server_gl.erl +++ b/lib/test_server/src/test_server_gl.erl @@ -37,7 +37,8 @@ reject_io :: boolean(), %Reject I/O requests... permit_io, %... and exceptions auto_nl=true :: boolean(), %Automatically add NL - levels %{Stdout,Major,Minor} + levels, %{Stdout,Major,Minor} + escape_chars=true %Switch escaping HTML on/off }). %% start_link() @@ -137,7 +138,8 @@ init([]) -> reject_io=false, permit_io=gb_sets:empty(), auto_nl=true, - levels={1,19,10} + levels={1,19,10}, + escape_chars=true }}. req(GL, Req) -> @@ -193,10 +195,11 @@ handle_info({io_request,From,ReplyAs,Req}=IoReq, St) -> #st{capture=CapturePid} -> CapturePid ! {captured,Data} end, - if EscapeHtml -> + case EscapeHtml andalso St#st.escape_chars of + true -> output(minor, test_server_ctrl:escape_chars(Data), From, From, St); - not EscapeHtml -> + false -> output(minor, Data, From, From, St) end end, @@ -218,7 +221,11 @@ handle_info({printout,Detail,Fun}, St) when is_function(Fun)-> {noreply,St}; handle_info({printout,Detail,Format,Args}, St) -> Str = io_lib:format(Format, Args), - output(Detail, Str, internal, none, St), + if not St#st.escape_chars -> + output(Detail, ["$tc_html",Str], internal, none, St); + true -> + output(Detail, Str, internal, none, St) + end, {noreply,St}; handle_info(Msg, #st{tc_supervisor=Pid}=St) when is_pid(Pid) -> %% The process overseeing the testcase process also used to be |