version 1.79, 2010/06/12 10:09:19 |
version 1.86, 2010/06/26 15:36:37 |
|
|
/* $Id$ */ |
/* $Id$ */ |
/* |
/* |
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se> |
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@bsd.lv> |
* |
* |
* Permission to use, copy, modify, and distribute this software for any |
* Permission to use, copy, modify, and distribute this software for any |
* purpose with or without fee is hereby granted, provided that the above |
* purpose with or without fee is hereby granted, provided that the above |
|
|
#include "mandoc.h" |
#include "mandoc.h" |
#include "out.h" |
#include "out.h" |
#include "html.h" |
#include "html.h" |
|
#include "regs.h" |
#include "mdoc.h" |
#include "mdoc.h" |
#include "main.h" |
#include "main.h" |
|
|
Line 1035 mdoc_it_pre(MDOC_ARGS) |
|
Line 1036 mdoc_it_pre(MDOC_ARGS) |
|
if (MDOC_BLOCK != n->type) |
if (MDOC_BLOCK != n->type) |
bl = bl->parent; |
bl = bl->parent; |
|
|
type = bl->data.list; |
SCALE_HS_INIT(&offs, 0); |
|
|
/* Set default width and offset. */ |
type = bl->data.Bl.type; |
|
comp = bl->data.Bl.comp; |
|
|
SCALE_HS_INIT(&offs, 0); |
if (bl->data.Bl.offs) |
|
a2offs(bl->data.Bl.offs, &offs); |
|
|
switch (type) { |
switch (type) { |
case (LIST_enum): |
case (LIST_enum): |
Line 1056 mdoc_it_pre(MDOC_ARGS) |
|
Line 1059 mdoc_it_pre(MDOC_ARGS) |
|
break; |
break; |
} |
} |
|
|
/* Get width, offset, and compact arguments. */ |
if (bl->data.Bl.width) |
|
a2width(bl->data.Bl.width, &width); |
|
|
wp = -1; |
wp = -1; |
for (comp = i = 0; bl->args && i < (int)bl->args->argc; i++) |
for (i = 0; bl->args && i < (int)bl->args->argc; i++) |
switch (bl->args->argv[i].arg) { |
switch (bl->args->argv[i].arg) { |
case (MDOC_Column): |
case (MDOC_Column): |
wp = i; /* Save for later. */ |
wp = i; /* Save for later. */ |
break; |
break; |
case (MDOC_Width): |
|
a2width(bl->args->argv[i].value[0], &width); |
|
break; |
|
case (MDOC_Offset): |
|
a2offs(bl->args->argv[i].value[0], &offs); |
|
break; |
|
case (MDOC_Compact): |
|
comp = 1; |
|
break; |
|
default: |
default: |
break; |
break; |
} |
} |
Line 1123 mdoc_bl_pre(MDOC_ARGS) |
|
Line 1118 mdoc_bl_pre(MDOC_ARGS) |
|
return(0); |
return(0); |
if (MDOC_BLOCK != n->type) |
if (MDOC_BLOCK != n->type) |
return(1); |
return(1); |
if (LIST_enum != n->data.list) |
if (LIST_enum != n->data.Bl.type) |
return(1); |
return(1); |
|
|
ord = malloc(sizeof(struct ord)); |
ord = malloc(sizeof(struct ord)); |
Line 1147 mdoc_bl_post(MDOC_ARGS) |
|
Line 1142 mdoc_bl_post(MDOC_ARGS) |
|
|
|
if (MDOC_BLOCK != n->type) |
if (MDOC_BLOCK != n->type) |
return; |
return; |
if (LIST_enum != n->data.list) |
if (LIST_enum != n->data.Bl.type) |
return; |
return; |
|
|
ord = h->ords.head; |
ord = h->ords.head; |
|
|
mdoc_bd_pre(MDOC_ARGS) |
mdoc_bd_pre(MDOC_ARGS) |
{ |
{ |
struct htmlpair tag[2]; |
struct htmlpair tag[2]; |
int comp, i; |
int comp; |
const struct mdoc_node *bl, *nn; |
const struct mdoc_node *nn; |
struct roffsu su; |
struct roffsu su; |
|
|
if (MDOC_BLOCK == n->type) |
if (MDOC_HEAD == n->type) |
bl = n; |
|
else if (MDOC_HEAD == n->type) |
|
return(0); |
return(0); |
else |
|
bl = n->parent; |
|
|
|
SCALE_VS_INIT(&su, 0); |
SCALE_VS_INIT(&su, 0); |
|
|
comp = 0; |
if (n->data.Bd.offs) |
for (i = 0; bl->args && i < (int)bl->args->argc; i++) |
a2offs(n->data.Bd.offs, &su); |
switch (bl->args->argv[i].arg) { |
|
case (MDOC_Offset): |
|
a2offs(bl->args->argv[i].value[0], &su); |
|
break; |
|
case (MDOC_Compact): |
|
comp = 1; |
|
break; |
|
default: |
|
break; |
|
} |
|
|
|
|
comp = n->data.Bd.comp; |
|
|
/* FIXME: -centered, etc. formatting. */ |
/* FIXME: -centered, etc. formatting. */ |
/* FIXME: does not respect -offset ??? */ |
/* FIXME: does not respect -offset ??? */ |
|
|
Line 1404 mdoc_bd_pre(MDOC_ARGS) |
|
Line 1387 mdoc_bd_pre(MDOC_ARGS) |
|
return(1); |
return(1); |
} |
} |
|
|
if (DISP_unfilled != n->data.disp && |
if (DISP_unfilled != n->data.Bd.type && |
DISP_literal != n->data.disp) |
DISP_literal != n->data.Bd.type) |
return(1); |
return(1); |
|
|
PAIR_CLASS_INIT(&tag[0], "lit"); |
PAIR_CLASS_INIT(&tag[0], "lit"); |