=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/mdoc_html.c,v retrieving revision 1.118 retrieving revision 1.119 diff -c -r1.118 -r1.119 *** src/usr.bin/mandoc/mdoc_html.c 2017/01/10 12:54:27 1.118 --- src/usr.bin/mandoc/mdoc_html.c 2017/01/10 13:46:53 1.119 *************** *** 1,4 **** ! /* $OpenBSD: mdoc_html.c,v 1.118 2017/01/10 12:54:27 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons * Copyright (c) 2014, 2015, 2016, 2017 Ingo Schwarze --- 1,4 ---- ! /* $OpenBSD: mdoc_html.c,v 1.119 2017/01/10 13:46:53 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons * Copyright (c) 2014, 2015, 2016, 2017 Ingo Schwarze *************** *** 284,290 **** synopsis_pre(struct html *h, const struct roff_node *n) { ! if (NULL == n->prev || ! (MDOC_SYNPRETTY & n->flags)) return; if (n->prev->tok == n->tok && --- 284,290 ---- synopsis_pre(struct html *h, const struct roff_node *n) { ! if (NULL == n->prev || ! (NODE_SYNPRETTY & n->flags)) return; if (n->prev->tok == n->tok && *************** *** 380,386 **** child = 1; t = h->tags.head; ! n->flags &= ~MDOC_ENDED; switch (n->type) { case ROFFT_TEXT: --- 380,386 ---- child = 1; t = h->tags.head; ! n->flags &= ~NODE_ENDED; switch (n->type) { case ROFFT_TEXT: *************** *** 391,407 **** * Make sure that if we're in a literal mode already * (i.e., within a
) don't print the newline.
  		 */
! 		if (' ' == *n->string && MDOC_LINE & n->flags)
  			if ( ! (HTML_LITERAL & h->flags))
  				print_otag(h, TAG_BR, 0, NULL);
! 		if (MDOC_DELIMC & n->flags)
  			h->flags |= HTML_NOSPACE;
  		print_text(h, n->string);
! 		if (MDOC_DELIMO & n->flags)
  			h->flags |= HTML_NOSPACE;
  		return;
  	case ROFFT_EQN:
! 		if (n->flags & MDOC_LINE)
  			putchar('\n');
  		print_eqn(h, n->eqn);
  		break;
--- 391,407 ----
  		 * Make sure that if we're in a literal mode already
  		 * (i.e., within a 
) don't print the newline.
  		 */
! 		if (' ' == *n->string && NODE_LINE & n->flags)
  			if ( ! (HTML_LITERAL & h->flags))
  				print_otag(h, TAG_BR, 0, NULL);
! 		if (NODE_DELIMC & n->flags)
  			h->flags |= HTML_NOSPACE;
  		print_text(h, n->string);
! 		if (NODE_DELIMO & n->flags)
  			h->flags |= HTML_NOSPACE;
  		return;
  	case ROFFT_EQN:
! 		if (n->flags & NODE_LINE)
  			putchar('\n');
  		print_eqn(h, n->eqn);
  		break;
***************
*** 429,435 ****
  		break;
  	}
  
! 	if (h->flags & HTML_KEEP && n->flags & MDOC_LINE) {
  		h->flags &= ~HTML_KEEP;
  		h->flags |= HTML_PREKEEP;
  	}
--- 429,435 ----
  		break;
  	}
  
! 	if (h->flags & HTML_KEEP && n->flags & NODE_LINE) {
  		h->flags &= ~HTML_KEEP;
  		h->flags |= HTML_PREKEEP;
  	}
***************
*** 443,453 ****
  	case ROFFT_EQN:
  		break;
  	default:
! 		if ( ! mdocs[n->tok].post || n->flags & MDOC_ENDED)
  			break;
  		(*mdocs[n->tok].post)(meta, n, h);
  		if (n->end != ENDBODY_NOT)
! 			n->body->flags |= MDOC_ENDED;
  		if (n->end == ENDBODY_NOSPACE)
  			h->flags |= HTML_NOSPACE;
  		break;
--- 443,453 ----
  	case ROFFT_EQN:
  		break;
  	default:
! 		if ( ! mdocs[n->tok].post || n->flags & NODE_ENDED)
  			break;
  		(*mdocs[n->tok].post)(meta, n, h);
  		if (n->end != ENDBODY_NOT)
! 			n->body->flags |= NODE_ENDED;
  		if (n->end == ENDBODY_NOSPACE)
  			h->flags |= HTML_NOSPACE;
  		break;
***************
*** 606,612 ****
  	if (!(n->child == NULL &&
  	    (n->next == NULL ||
  	     n->next->type == ROFFT_TEXT ||
! 	     n->next->flags & MDOC_LINE)))
  		h->flags |= HTML_NOSPACE;
  
  	return 1;
--- 606,612 ----
  	if (!(n->child == NULL &&
  	    (n->next == NULL ||
  	     n->next->type == ROFFT_TEXT ||
! 	     n->next->flags & NODE_LINE)))
  		h->flags |= HTML_NOSPACE;
  
  	return 1;
***************
*** 712,718 ****
  mdoc_ns_pre(MDOC_ARGS)
  {
  
! 	if ( ! (MDOC_LINE & n->flags))
  		h->flags |= HTML_NOSPACE;
  	return 1;
  }
--- 712,718 ----
  mdoc_ns_pre(MDOC_ARGS)
  {
  
! 	if ( ! (NODE_LINE & n->flags))
  		h->flags |= HTML_NOSPACE;
  	return 1;
  }
***************
*** 1159,1165 ****
  			break;
  		}
  		if (h->flags & HTML_NONEWLINE ||
! 		    (nn->next && ! (nn->next->flags & MDOC_LINE)))
  			continue;
  		else if (nn->next)
  			print_text(h, "\n");
--- 1159,1165 ----
  			break;
  		}
  		if (h->flags & HTML_NONEWLINE ||
! 		    (nn->next && ! (nn->next->flags & NODE_LINE)))
  			continue;
  		else if (nn->next)
  			print_text(h, "\n");
***************
*** 1398,1404 ****
  	const char	*sp, *ep;
  	int		 sz, i, pretty;
  
! 	pretty = MDOC_SYNPRETTY & n->flags;
  	synopsis_pre(h, n);
  
  	/* Split apart into type and name. */
--- 1398,1404 ----
  	const char	*sp, *ep;
  	int		 sz, i, pretty;
  
! 	pretty = NODE_SYNPRETTY & n->flags;
  	synopsis_pre(h, n);
  
  	/* Split apart into type and name. */
***************
*** 1428,1434 ****
  	 */
  
  #if 0
! 	if (MDOC_SYNPRETTY & n->flags) {
  		nbuf[0] = '\0';
  		html_idcat(nbuf, sp, BUFSIZ);
  		PAIR_ID_INIT(&tag[1], nbuf);
--- 1428,1434 ----
  	 */
  
  #if 0
! 	if (NODE_SYNPRETTY & n->flags) {
  		nbuf[0] = '\0';
  		html_idcat(nbuf, sp, BUFSIZ);
  		PAIR_ID_INIT(&tag[1], nbuf);
***************
*** 1457,1463 ****
  
  	for (n = n->child->next; n; n = n->next) {
  		i = 1;
! 		if (MDOC_SYNPRETTY & n->flags)
  			i = 2;
  		t = print_otag(h, TAG_I, i, tag);
  		print_text(h, n->string);
--- 1457,1463 ----
  
  	for (n = n->child->next; n; n = n->next) {
  		i = 1;
! 		if (NODE_SYNPRETTY & n->flags)
  			i = 2;
  		t = print_otag(h, TAG_I, i, tag);
  		print_text(h, n->string);
***************
*** 1647,1653 ****
  	 * of no children.
  	 */
  
! 	if (MDOC_SYNPRETTY & n->flags && MDOC_LINE & n->flags)
  		print_text(h, "#include");
  
  	print_text(h, "<");
--- 1647,1653 ----
  	 * of no children.
  	 */
  
! 	if (NODE_SYNPRETTY & n->flags && NODE_LINE & n->flags)
  		print_text(h, "#include");
  
  	print_text(h, "<");
***************
*** 1824,1830 ****
  mdoc_pf_post(MDOC_ARGS)
  {
  
! 	if ( ! (n->next == NULL || n->next->flags & MDOC_LINE))
  		h->flags |= HTML_NOSPACE;
  }
  
--- 1824,1830 ----
  mdoc_pf_post(MDOC_ARGS)
  {
  
! 	if ( ! (n->next == NULL || n->next->flags & NODE_LINE))
  		h->flags |= HTML_NOSPACE;
  }
  
***************
*** 1895,1901 ****
  {
  	struct htmlpair	tag;
  
! 	if (SEC_LIBRARY == n->sec && MDOC_LINE & n->flags && n->prev)
  		print_otag(h, TAG_BR, 0, NULL);
  
  	PAIR_CLASS_INIT(&tag, "lib");
--- 1895,1901 ----
  {
  	struct htmlpair	tag;
  
! 	if (SEC_LIBRARY == n->sec && NODE_LINE & n->flags && n->prev)
  		print_otag(h, TAG_BR, 0, NULL);
  
  	PAIR_CLASS_INIT(&tag, "lib");