version 1.59, 2019/03/22 16:55:44 |
version 1.61, 2019/03/22 17:28:59 |
|
|
|
|
static const char *attrkeys[ATTRKEY__MAX] = { |
static const char *attrkeys[ATTRKEY__MAX] = { |
"choice", |
"choice", |
|
"class", |
"close", |
"close", |
"id", |
"id", |
"linkend", |
"linkend", |
Line 85 static const char *attrkeys[ATTRKEY__MAX] = { |
|
Line 86 static const char *attrkeys[ATTRKEY__MAX] = { |
|
}; |
}; |
|
|
static const char *attrvals[ATTRVAL__MAX] = { |
static const char *attrvals[ATTRVAL__MAX] = { |
|
"monospaced", |
"norepeat", |
"norepeat", |
"opt", |
"opt", |
"plain", |
"plain", |
Line 491 pnode_unlinksub(struct pnode *pn) |
|
Line 493 pnode_unlinksub(struct pnode *pn) |
|
} |
} |
|
|
/* |
/* |
|
* Retrieve an enumeration attribute from a node. |
|
* Return ATTRVAL__MAX if the node has no such attribute. |
|
*/ |
|
enum attrval |
|
pnode_getattr(struct pnode *pn, enum attrkey key) |
|
{ |
|
struct pattr *ap; |
|
|
|
TAILQ_FOREACH(ap, &pn->attrq, child) |
|
if (ap->key == key) |
|
return ap->val; |
|
return(ATTRVAL__MAX); |
|
} |
|
|
|
/* |
* Retrieve an attribute string from a node. |
* Retrieve an attribute string from a node. |
* Return defval if the node has no such attribute. |
* Return defval if the node has no such attribute. |
*/ |
*/ |
Line 703 pnode_printpara(struct parse *p, struct pnode *pn) |
|
Line 720 pnode_printpara(struct parse *p, struct pnode *pn) |
|
struct pnode *pp; |
struct pnode *pp; |
|
|
assert(p->newln); |
assert(p->newln); |
if (NULL == pn->parent || NODE_LISTITEM == pn->parent->node) |
if ((pp = TAILQ_PREV(pn, pnodeq, child)) == NULL && |
|
(pp = pn->parent) == NULL) |
return; |
return; |
|
|
pp = TAILQ_PREV(pn, pnodeq, child); |
switch (pp->node) { |
if (NULL == pp) |
case NODE_ENTRY: |
pp = pn->parent; |
case NODE_LISTITEM: |
if ((NODE_SECTION != pp->node && NODE_PREFACE != pp->node) || |
return; |
2 < p->level) |
case NODE_PREFACE: |
puts(".Pp"); |
case NODE_SECTION: |
|
if (p->level < 3) |
|
return; |
|
break; |
|
default: |
|
break; |
|
} |
|
puts(".Pp"); |
} |
} |
|
|
/* |
/* |
Line 1369 pnode_print(struct parse *p, struct pnode *pn) |
|
Line 1394 pnode_print(struct parse *p, struct pnode *pn) |
|
pnode_printmopen(p); |
pnode_printmopen(p); |
fputs("Li", stdout); |
fputs("Li", stdout); |
break; |
break; |
|
case (NODE_LITERALLAYOUT): |
|
assert(p->newln); |
|
puts(".Bd -literal"); |
|
break; |
case (NODE_MML_MFENCED): |
case (NODE_MML_MFENCED): |
pnode_printmathfenced(p, pn); |
pnode_printmathfenced(p, pn); |
pnode_unlinksub(pn); |
pnode_unlinksub(pn); |
Line 1411 pnode_print(struct parse *p, struct pnode *pn) |
|
Line 1440 pnode_print(struct parse *p, struct pnode *pn) |
|
pnode_printmopen(p); |
pnode_printmopen(p); |
fputs("Qo", stdout); |
fputs("Qo", stdout); |
break; |
break; |
case (NODE_LITERALLAYOUT): |
|
/* FALLTHROUGH */ |
|
case (NODE_PROGRAMLISTING): |
case (NODE_PROGRAMLISTING): |
/* FALLTHROUGH */ |
|
case (NODE_SCREEN): |
case (NODE_SCREEN): |
assert(p->newln); |
assert(p->newln); |
puts(".Bd -literal"); |
printf(".Bd %s\n", ATTRVAL_MONOSPACED == |
|
pnode_getattr(pn, ATTRKEY_CLASS) ? |
|
"-literal" : "-unfilled"); |
break; |
break; |
case (NODE_REFENTRYINFO): |
case (NODE_REFENTRYINFO): |
/* Suppress. */ |
/* Suppress. */ |