version 1.151, 2020/03/13 15:32:28 |
version 1.153, 2020/04/18 20:40:10 |
|
|
#include "mandoc_aux.h" |
#include "mandoc_aux.h" |
#include "mandoc.h" |
#include "mandoc.h" |
#include "roff.h" |
#include "roff.h" |
#include "tag.h" |
|
#include "man.h" |
#include "man.h" |
#include "libmandoc.h" |
#include "libmandoc.h" |
#include "roff_int.h" |
#include "roff_int.h" |
#include "libman.h" |
#include "libman.h" |
|
#include "tag.h" |
|
|
#define CHKARGS struct roff_man *man, struct roff_node *n |
#define CHKARGS struct roff_man *man, struct roff_node *n |
|
|
|
|
post_SH(CHKARGS) |
post_SH(CHKARGS) |
{ |
{ |
struct roff_node *nc; |
struct roff_node *nc; |
|
char *cp, *tag; |
|
|
if (n->type != ROFFT_BODY || (nc = n->child) == NULL) |
nc = n->child; |
|
switch (n->type) { |
|
case ROFFT_HEAD: |
|
tag = NULL; |
|
deroff(&tag, n); |
|
if (tag != NULL) { |
|
for (cp = tag; *cp != '\0'; cp++) |
|
if (*cp == ' ') |
|
*cp = '_'; |
|
if (nc != NULL && nc->type == ROFFT_TEXT && |
|
strcmp(nc->string, tag) == 0) |
|
tag_put(NULL, TAG_WEAK, n); |
|
else |
|
tag_put(tag, TAG_FALLBACK, n); |
|
free(tag); |
|
} |
return; |
return; |
|
case ROFFT_BODY: |
|
if (nc != NULL) |
|
break; |
|
return; |
|
default: |
|
return; |
|
} |
|
|
if (nc->tok == MAN_PP && nc->body->child != NULL) { |
if (nc->tok == MAN_PP && nc->body->child != NULL) { |
while (nc->body->last != NULL) { |
while (nc->body->last != NULL) { |