diff options
Diffstat (limited to 'src/asciideck_inline_pass.erl')
-rw-r--r-- | src/asciideck_inline_pass.erl | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/asciideck_inline_pass.erl b/src/asciideck_inline_pass.erl index 469c9f3..4bc4017 100644 --- a/src/asciideck_inline_pass.erl +++ b/src/asciideck_inline_pass.erl @@ -68,7 +68,9 @@ inline(Data, BinAcc, Acc) -> fun emphasized_underline/2, fun strong/2, %% Passthrough macros. - fun inline_literal_passthrough/2 + fun inline_literal_passthrough/2, + %% Line breaks. + fun line_break/2 ]). %% The inline pass replaces \r\n and \n with a simple space @@ -323,3 +325,10 @@ inline_literal_passthrough_test() -> ] = inline(<<"Word phrases `enclosed in backtick characters` (grave accents)...">>), ok. -endif. + +-define(IS_WS(C), (C =:= $\s) or (C =:= $\t)). + +%% Asciidoc User Guide 10.3 +line_break(<<C, "+", Rest0/bits>>, _) when ?IS_WS(C) -> + %% @todo Rest0 until \r or \n is whitespace. + {ok, {line_break, #{}, <<>>, inline}, Rest0}. |