- switch (t) {
- case (MDOC_Column):
- /* FALLTHROUGH */
- case (MDOC_Item):
- /* FALLTHROUGH */
- case (MDOC_Ohang):
- buffmt("margin-left: %dem; clear: both;", o);
- break;
- default:
- buffmt("margin-left: %dem; clear: both;", w + o);
- break;
+ nn = n->parent->parent;
+ assert(nn->args);
+
+ /* XXX: see notes in mdoc_it_pre(). */
+
+ if (MDOC_Column == type) {
+ /* Don't width-pad on the left. */
+ SCALE_HS_INIT(width, 0);
+ /* Also disallow non-compact. */
+ comp = 1;
+ }
+ if (MDOC_Diag == type)
+ /* Mandate non-compact with empty prior. */
+ if (n->prev && NULL == n->prev->body->child)
+ comp = 1;
+
+ bufcat_style(h, "clear", "both");
+ if (offs->scale > 0)
+ bufcat_su(h, "margin-left", offs);
+ if (width->scale > 0)
+ bufcat_su(h, "padding-left", width);
+
+ PAIR_STYLE_INIT(&tag, h);
+
+ /* Mandate compact following `Ss' and `Sh' starts. */
+
+ for (nn = n; nn && ! comp; nn = nn->parent) {
+ if (MDOC_BLOCK != nn->type)
+ continue;
+ if (MDOC_Ss == nn->tok || MDOC_Sh == nn->tok)
+ comp = 1;
+ if (nn->prev)
+ break;