HTML cover report should escape comments

View: New views
2 Messages — Rating Filter:   Alert me  

HTML cover report should escape comments

by Magnus Henoch-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

cover does not escape < and > in comments when generating HTML reports.
Here is a patch that fixes that: (R12B-5 and R13A)

--- cover.erl.orig 2009-04-06 11:44:29.000000000 +0100
+++ cover.erl 2009-04-06 11:46:11.000000000 +0100
@@ -1792,7 +1792,7 @@
  eof ->
     ignore;
  "%"++_=Line -> %Comment line - not executed.
-    io:put_chars(OutFd, [tab(),Line]),
+    io:put_chars(OutFd, [tab(), escape_lt_and_gt(Line, HTML)]),
     print_lines(Module, InFd, OutFd, L+1, HTML);
  RawLine ->
     Line = escape_lt_and_gt(RawLine,HTML),


--
Magnus Henoch, magnus@...
Erlang Training and Consulting
http://www.erlang-consulting.com/

_______________________________________________
erlang-patches mailing list
erlang-patches@...
http://www.erlang.org/mailman/listinfo/erlang-patches

Re: HTML cover report should escape comments

by Bjorn Gustavsson-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Apr 6, 2009 at 12:54 PM, Magnus Henoch
<magnus@...> wrote:

> cover does not escape < and > in comments when generating HTML reports.
> Here is a patch that fixes that: (R12B-5 and R13A)
>
> --- cover.erl.orig      2009-04-06 11:44:29.000000000 +0100
> +++ cover.erl   2009-04-06 11:46:11.000000000 +0100
> @@ -1792,7 +1792,7 @@
>        eof ->
>            ignore;
>        "%"++_=Line ->                          %Comment line - not executed.
> -           io:put_chars(OutFd, [tab(),Line]),
> +           io:put_chars(OutFd, [tab(), escape_lt_and_gt(Line, HTML)]),
>            print_lines(Module, InFd, OutFd, L+1, HTML);
>        RawLine ->
>            Line = escape_lt_and_gt(RawLine,HTML),
>

Thanks for the patch. It will be included in R13B.

/Bjorn

> _______________________________________________
> erlang-patches mailing list
> erlang-patches@...
> http://www.erlang.org/mailman/listinfo/erlang-patches
>



--
Björn Gustavsson, Erlang/OTP, Ericsson AB
_______________________________________________
erlang-patches mailing list
erlang-patches@...
http://www.erlang.org/mailman/listinfo/erlang-patches