|
14 | 14 |
|
15 | 15 | -module(asciideck_to_html). |
16 | 16 |
|
17 | | --ifdef(OTP_RELEASE). |
18 | | --compile({nowarn_deprecated_function, [{erlang, get_stacktrace, 0}]}). |
19 | | --endif. |
20 | | - |
21 | 17 | -export([translate/2]). |
22 | 18 |
|
23 | 19 | translate(AST, Opts) -> |
@@ -81,8 +77,8 @@ ast_node(Node={Type, _, _, _}) -> |
81 | 77 | comment_line -> comment_line(Node); |
82 | 78 | _ -> ast_error({unknown_type, Node}) |
83 | 79 | end |
84 | | - catch C:E -> |
85 | | - ast_error({crash, C, E, erlang:get_stacktrace(), Node}) |
| 80 | + catch C:E:S -> |
| 81 | + ast_error({crash, C, E, S, Node}) |
86 | 82 | end. |
87 | 83 |
|
88 | 84 | ast_error(Error) -> |
@@ -124,7 +120,7 @@ paragraph({paragraph, _, Text, _}) -> |
124 | 120 | listing_block({listing_block, Attrs, Listing0, _}) -> |
125 | 121 | Listing = case Attrs of |
126 | 122 | #{1 := <<"source">>, 2 := _} -> |
127 | | - try asciideck_source_highlight:filter(Listing0, Attrs) catch C:E -> io:format("~p ~p ~p~n", [C, E, erlang:get_stacktrace()]), exit(bad) end; |
| 123 | + try asciideck_source_highlight:filter(Listing0, Attrs) catch C:E:S -> io:format("~p ~p ~p~n", [C, E, S]), exit(bad) end; |
128 | 124 | _ -> |
129 | 125 | ["<pre>", html_encode(Listing0), "</pre>"] |
130 | 126 | end, |
|
0 commit comments