diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2010-06-29 19:20:38 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2010-06-29 19:20:38 +0000 |
commit | 4c7036f39cd338c9cd69fe37813577f0f4a1bc69 (patch) | |
tree | e5acb7c52eab35523e9ecd1eea6b370402dc92f0 /libmdoc.h | |
parent | 1d0a7892377ad99dbf5e1bcd38b15f01a53a28c9 (diff) | |
download | mandoc-4c7036f39cd338c9cd69fe37813577f0f4a1bc69.tar.gz mandoc-4c7036f39cd338c9cd69fe37813577f0f4a1bc69.tar.zst mandoc-4c7036f39cd338c9cd69fe37813577f0f4a1bc69.zip |
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:
"<ao1 <ao2 [bo ac2> 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@
Diffstat (limited to 'libmdoc.h')
-rw-r--r-- | libmdoc.h | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -1,4 +1,4 @@ -/* $Id: libmdoc.h,v 1.57 2010/06/27 16:18:13 kristaps Exp $ */ +/* $Id: libmdoc.h,v 1.58 2010/06/29 19:20:38 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -109,6 +109,9 @@ int mdoc_block_alloc(struct mdoc *, int, int, int mdoc_head_alloc(struct mdoc *, int, int, enum mdoct); int mdoc_tail_alloc(struct mdoc *, int, int, enum mdoct); int mdoc_body_alloc(struct mdoc *, int, int, enum mdoct); +int mdoc_endbody_alloc(struct mdoc *m, int line, int pos, + enum mdoct tok, struct mdoc_node *body, + enum mdoc_endbody end); void mdoc_node_delete(struct mdoc *, struct mdoc_node *); void mdoc_hash_init(void); enum mdoct mdoc_hash_find(const char *); |