aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2016-11-04 19:45:25 +0200
committerLoïc Hoguin <[email protected]>2016-11-04 19:45:25 +0200
commit26b9f935e2abcf9ba79ee78b918a556bc2290190 (patch)
tree082d47d7bf49fee273e2240619d908fce8f3284d
parentf701e5f7a7a7111743c5c30b1c5e30220761bb50 (diff)
downloadasciideck-26b9f935e2abcf9ba79ee78b918a556bc2290190.tar.gz
asciideck-26b9f935e2abcf9ba79ee78b918a556bc2290190.tar.bz2
asciideck-26b9f935e2abcf9ba79ee78b918a556bc2290190.zip
Unescape pipes when parsing table cells
-rw-r--r--src/asciideck_parser.erl6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/asciideck_parser.erl b/src/asciideck_parser.erl
index 93efc41..8f4f558 100644
--- a/src/asciideck_parser.erl
+++ b/src/asciideck_parser.erl
@@ -129,8 +129,8 @@ p1_table(Tail, AST, St, LN) ->
%% @todo Strip whitespace at the beginning of the cell if on the same line.
p1_cell(Tail=[{_, NextLine}|_], AST0, St, LN, Text) ->
case p1_cell_split(Text, <<>>) of
- [_] ->
- AST1 = [nl, cell(p1([{LN, trim_ws(Text)}, {LN, <<>>}], [], St), ann(LN, St))|AST0],
+ [Cell] ->
+ AST1 = [nl, cell(p1([{LN, trim_ws(Cell)}, {LN, <<>>}], [], St), ann(LN, St))|AST0],
AST = case NextLine of
<<>> -> [nl|AST1];
_ -> AST1
@@ -143,7 +143,7 @@ p1_cell(Tail=[{_, NextLine}|_], AST0, St, LN, Text) ->
p1_cell_split(<<>>, Acc) ->
[Acc];
p1_cell_split(<< $\\, $|, Rest/bits >>, Acc) ->
- p1_cell_split(Rest, << Acc/binary, $\\, $| >>);
+ p1_cell_split(Rest, << Acc/binary, $| >>);
p1_cell_split(<< $|, Rest/bits >>, Acc) ->
[Acc, Rest];
p1_cell_split(<< C, Rest/bits >>, Acc) ->