aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2016-11-02 01:39:22 +0200
committerLoïc Hoguin <[email protected]>2016-11-02 01:39:22 +0200
commit9f6a71bca90a714de1122a8a1f6783391b0c7f69 (patch)
treeee647b23e814aa702dae3bd914662c51c3b3e5aa
parent0cc2e3f30a4939363ff7b444ecb22f725b3e69e9 (diff)
downloadasciideck-9f6a71bca90a714de1122a8a1f6783391b0c7f69.tar.gz
asciideck-9f6a71bca90a714de1122a8a1f6783391b0c7f69.tar.bz2
asciideck-9f6a71bca90a714de1122a8a1f6783391b0c7f69.zip
Ignore comments inside paragraphs
-rw-r--r--src/asciideck_parser.erl4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/asciideck_parser.erl b/src/asciideck_parser.erl
index f7a61d7..a75e99f 100644
--- a/src/asciideck_parser.erl
+++ b/src/asciideck_parser.erl
@@ -229,6 +229,10 @@ p1_p([{_, <<>>}|Tail], AST0, St, LN, [_|Acc]) ->
AST ->
p1(Tail, [paragraph(Text, #{}, ann(LN, St))|AST], St)
end;
+%% Ignore comments inside paragraphs.
+%% @todo Keep in the AST.
+p1_p([{_, <<"//", _/bits>>}|Tail], AST, St, LN, Acc) ->
+ p1_p(Tail, AST, St, LN, Acc);
p1_p([{_, Line}|Tail], AST, St, LN, Acc) ->
%% @todo We need to keep line/col information. To do this
%% we probably should keep an index of character number -> line/col