diff options
author | Loïc Hoguin <[email protected]> | 2016-11-02 01:39:02 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2016-11-02 01:39:02 +0200 |
commit | 0cc2e3f30a4939363ff7b444ecb22f725b3e69e9 (patch) | |
tree | 06b94911c2d04de507b3796b6f3af8e0c928c411 /src/asciideck_to_manpage.erl | |
parent | 5d64adce092214bd33b395e6d3279c3eb585c6b1 (diff) | |
download | asciideck-0cc2e3f30a4939363ff7b444ecb22f725b3e69e9.tar.gz asciideck-0cc2e3f30a4939363ff7b444ecb22f725b3e69e9.tar.bz2 asciideck-0cc2e3f30a4939363ff7b444ecb22f725b3e69e9.zip |
Handle labeled lists the same as normal lists
Including support for lists continuations.
Diffstat (limited to 'src/asciideck_to_manpage.erl')
-rw-r--r-- | src/asciideck_to_manpage.erl | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/asciideck_to_manpage.erl b/src/asciideck_to_manpage.erl index fffd250..33187ea 100644 --- a/src/asciideck_to_manpage.erl +++ b/src/asciideck_to_manpage.erl @@ -111,15 +111,20 @@ man([_Ignore|Tail], Acc) -> man_ll([], Acc) -> Acc; -man_ll([{li, #{label := Label}, [{p, _PAttrs, Text, _PAnn}], _LiAnn}|Tail], Acc0) -> +man_ll([{li, #{label := Label}, Item, _LiAnn}|Tail], Acc0) -> Acc = [[ ".PP\n" "\\fB", Label, "\\fR\n", ".RS 4\n", - man_format(Text), "\n" + man_ll_item(Item), ".RE\n"]|Acc0], man_ll(Tail, Acc). +man_ll_item([{p, _PAttrs, Text, _PAnn}]) -> + [man_format(Text), "\n"]; +man_ll_item([{p, _PAttrs, Text, _PAnn}|Tail]) -> + [man_format(Text), "\n\n", man_ll_item(Tail)]. + man_ul([], Acc) -> Acc; man_ul([{li, _LiAttrs, [{p, _PAttrs, Text, _PAnn}], _LiAnn}|Tail], Acc0) -> |