From 9f6a71bca90a714de1122a8a1f6783391b0c7f69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Wed, 2 Nov 2016 01:39:22 +0200 Subject: Ignore comments inside paragraphs --- src/asciideck_parser.erl | 4 ++++ 1 file changed, 4 insertions(+) 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 -- cgit v1.2.3