From fa27f3e4dde348926a1727b36e394aafffad3741 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Tue, 29 Jun 2010 19:20:38 +0000 Subject: Support for badly nested blocks, written around the time of the Rostock mandoc hackathon and tested and polished since, supporting constructs like: .Ao Bo Ac Bc (exp breaking exp) .Aq Bo eol Bc (imp breaking exp) .Ao Bq Ac eol (exp breaking imp) .Ao Bo So Bc Ac Sc (double break, inner before outer) .Ao Bo So Ac Bc Sc (double break, outer before inner) .Ao Bo Ac So Bc Sc (broken breaker) .Ao Bo So Bc Do Ac Sc Dc (broken double breaker) There are still two known issues which are tricky: 1) Breaking two identical explicit blocks (Ao Bo Bo Ac or Aq Bo Bo eol) fails outright, triggering a bogus syntax error. 2) Breaking a block by two identical explicit blocks (Ao Ao Bo Ac Ac Bc or Ao Ao Bq Ac Ac eol) still has a minor rendering error left: " ac1> bc]>" should not have the final ">". We can fix these later in the tree, let's not grow this diff too large. "get it in" kristaps@ --- tree.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tree.c') diff --git a/tree.c b/tree.c index 1156a0d7..a5071b29 100644 --- a/tree.c +++ b/tree.c @@ -75,7 +75,10 @@ print_mdoc(const struct mdoc_node *n, int indent) t = "block-head"; break; case (MDOC_BODY): - t = "block-body"; + if (n->end) + t = "body-end"; + else + t = "block-body"; break; case (MDOC_TAIL): t = "block-tail"; -- cgit