aboutsummaryrefslogtreecommitdiffstats
path: root/src/asciideck.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/asciideck.erl')
-rw-r--r--src/asciideck.erl13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/asciideck.erl b/src/asciideck.erl
index 749ccec..bd5792c 100644
--- a/src/asciideck.erl
+++ b/src/asciideck.erl
@@ -1,4 +1,4 @@
-%% Copyright (c) 2016, Loïc Hoguin <[email protected]>
+%% Copyright (c) 2016-2018, Loïc Hoguin <[email protected]>
%%
%% Permission to use, copy, modify, and/or distribute this software for any
%% purpose with or without fee is hereby granted, provided that the above
@@ -32,8 +32,15 @@ parse_file(Filename, St) ->
parse(Data) ->
parse(Data, #{}).
-parse(Data, St) when is_binary(Data) ->
- asciideck_parser:parse(Data, St);
+parse(Data, _St) when is_binary(Data) ->
+ Passes = [
+ asciideck_attributes_pass,
+ asciideck_lists_pass,
+ asciideck_tables_pass,
+ asciideck_inline_pass
+ ],
+ lists:foldl(fun(M, AST) -> M:run(AST) end,
+ asciideck_block_parser:parse(Data), Passes);
parse(Data, St) ->
parse(iolist_to_binary(Data), St).