git: 06bcf00f8740 - stable/13 - mandoc: import version 1.14.6

From: Baptiste Daroussin <bapt_at_FreeBSD.org>
Date: Wed, 12 Oct 2022 09:06:43 UTC
The branch stable/13 has been updated by bapt:

URL: https://cgit.FreeBSD.org/src/commit/?id=06bcf00f87400f6671a7d02ac4a21e5d07aca045

commit 06bcf00f87400f6671a7d02ac4a21e5d07aca045
Author:     Baptiste Daroussin <bapt@FreeBSD.org>
AuthorDate: 2021-11-15 15:54:38 +0000
Commit:     Baptiste Daroussin <bapt@FreeBSD.org>
CommitDate: 2022-10-12 09:04:46 +0000

    mandoc: import version 1.14.6
    
    MFC after: 3 weeks
    
    (cherry picked from commit 6d38604fc532a3fc060788e3ce40464b46047eaf)
---
 contrib/mandoc/INSTALL                 |  17 +-
 contrib/mandoc/LICENSE                 |   6 +-
 contrib/mandoc/Makefile                |  64 ++-
 contrib/mandoc/Makefile.depend         |  38 +-
 contrib/mandoc/NEWS                    | 201 ++++++-
 contrib/mandoc/TODO                    | 142 ++++-
 contrib/mandoc/apropos.1               |  15 +-
 contrib/mandoc/arch.c                  |   4 +-
 contrib/mandoc/att.c                   |   4 +-
 contrib/mandoc/catman.c                |   4 +-
 contrib/mandoc/cgi.c                   |  72 ++-
 contrib/mandoc/chars.c                 |   7 +-
 contrib/mandoc/compat_err.c            |  13 +-
 contrib/mandoc/compat_fts.c            |  29 +-
 contrib/mandoc/compat_fts.h            |   3 +-
 contrib/mandoc/compat_getline.c        |  13 +-
 contrib/mandoc/compat_getsubopt.c      |  13 +-
 contrib/mandoc/compat_isblank.c        |  14 +-
 contrib/mandoc/compat_mkdtemp.c        |  23 +-
 contrib/mandoc/compat_mkstemps.c       |  63 +++
 contrib/mandoc/compat_ohash.c          |  13 +-
 contrib/mandoc/compat_progname.c       |  15 +-
 contrib/mandoc/compat_reallocarray.c   |  15 +-
 contrib/mandoc/compat_recallocarray.c  |  25 +-
 contrib/mandoc/compat_strcasestr.c     |  13 +-
 contrib/mandoc/compat_stringlist.c     |  82 +--
 contrib/mandoc/compat_stringlist.h     |  43 +-
 contrib/mandoc/compat_strlcat.c        |  62 +--
 contrib/mandoc/compat_strlcpy.c        |  49 +-
 contrib/mandoc/compat_strndup.c        |  16 +-
 contrib/mandoc/compat_strsep.c         |  15 +-
 contrib/mandoc/compat_strtonum.c       |  15 +-
 contrib/mandoc/compat_vasprintf.c      |  13 +-
 contrib/mandoc/config.h                |   8 +-
 contrib/mandoc/configure               | 313 ++++++-----
 contrib/mandoc/configure.local.example |  71 ++-
 contrib/mandoc/dba_array.c             |   4 +-
 contrib/mandoc/dba_read.c              |   4 +-
 contrib/mandoc/eqn.7                   |  55 +-
 contrib/mandoc/eqn.c                   |  14 +-
 contrib/mandoc/html.c                  | 337 ++++++++----
 contrib/mandoc/html.h                  |  36 +-
 contrib/mandoc/libmandoc.h             |  14 +-
 contrib/mandoc/main.c                  | 961 +++++++++++++++++++--------------
 contrib/mandoc/man.1                   |  98 ++--
 contrib/mandoc/man.7                   |  55 +-
 contrib/mandoc/man.conf.5              |  14 +-
 contrib/mandoc/man_html.c              |  43 +-
 contrib/mandoc/man_macro.c             |  12 +-
 contrib/mandoc/man_term.c              | 132 +----
 contrib/mandoc/man_validate.c          | 157 +++++-
 contrib/mandoc/manconf.h               |  10 +-
 contrib/mandoc/mandoc.1                | 141 ++++-
 contrib/mandoc/mandoc.c                |  85 +--
 contrib/mandoc/mandoc.css              |   7 +-
 contrib/mandoc/mandoc.h                |  22 +-
 contrib/mandoc/mandoc_char.7           |  21 +-
 contrib/mandoc/mandoc_headers.3        |  79 ++-
 contrib/mandoc/mandoc_html.3           | 270 ++++++++-
 contrib/mandoc/mandoc_malloc.3         |  41 +-
 contrib/mandoc/mandoc_msg.c            |  17 +-
 contrib/mandoc/mandoc_ohash.c          |   4 +-
 contrib/mandoc/mandoc_parse.h          |   3 +-
 contrib/mandoc/mandoc_xr.c             |   4 +-
 contrib/mandoc/mandocd.c               |   4 +-
 contrib/mandoc/mandocdb.c              | 247 ++++++---
 contrib/mandoc/manpath.c               |  48 +-
 contrib/mandoc/mdoc.7                  | 183 +++++--
 contrib/mandoc/mdoc.c                  |  13 +-
 contrib/mandoc/mdoc_html.c             | 385 ++++++-------
 contrib/mandoc/mdoc_macro.c            |   7 +-
 contrib/mandoc/mdoc_man.c              | 124 +++--
 contrib/mandoc/mdoc_markdown.c         |  55 +-
 contrib/mandoc/mdoc_state.c            |   5 +-
 contrib/mandoc/mdoc_term.c             | 440 ++++++---------
 contrib/mandoc/mdoc_validate.c         | 527 ++++++++++++------
 contrib/mandoc/out.c                   |  75 ++-
 contrib/mandoc/out.h                   |   6 +-
 contrib/mandoc/read.c                  |  31 +-
 contrib/mandoc/roff.7                  |   8 +-
 contrib/mandoc/roff.c                  | 233 +++++---
 contrib/mandoc/roff.h                  |  17 +-
 contrib/mandoc/roff_html.c             |   4 +-
 contrib/mandoc/roff_int.h              |   5 +-
 contrib/mandoc/roff_term.c             |  56 +-
 contrib/mandoc/roff_validate.c         |  10 +-
 contrib/mandoc/soelim.c                |   8 +-
 contrib/mandoc/tag.c                   | 415 +++++++-------
 contrib/mandoc/tag.h                   |  35 +-
 contrib/mandoc/tbl.7                   |  13 +-
 contrib/mandoc/tbl.h                   |   7 +-
 contrib/mandoc/tbl_data.c              |  53 +-
 contrib/mandoc/tbl_html.c              |  42 +-
 contrib/mandoc/tbl_layout.c            |  63 ++-
 contrib/mandoc/tbl_term.c              |  60 +-
 contrib/mandoc/term.c                  |  25 +-
 contrib/mandoc/term_ascii.c            |  32 +-
 contrib/mandoc/term_ps.c               |   9 +-
 contrib/mandoc/term_tab.c              |   4 +-
 contrib/mandoc/term_tag.c              | 227 ++++++++
 contrib/mandoc/term_tag.h              |  34 ++
 contrib/mandoc/test-attribute.c        |  48 ++
 contrib/mandoc/test-mkstemps.c         |  12 +
 contrib/mandoc/tree.c                  | 201 +++++--
 usr.bin/mandoc/Makefile                |   1 +
 105 files changed, 5029 insertions(+), 2896 deletions(-)

diff --git a/contrib/mandoc/INSTALL b/contrib/mandoc/INSTALL
index 3c09f3f214cb..e79674a16aa4 100644
--- a/contrib/mandoc/INSTALL
+++ b/contrib/mandoc/INSTALL
@@ -1,4 +1,4 @@
-$Id: INSTALL,v 1.23 2019/03/06 15:58:10 schwarze Exp $
+$Id: INSTALL,v 1.24 2021/09/20 13:25:42 schwarze Exp $
 
 About the portable mandoc distribution
 --------------------------------------
@@ -18,7 +18,7 @@ tech@ mailing list, too.
 
 Enjoy using the mandoc toolset!
 
-Ingo Schwarze, Karlsruhe, March 2019
+Ingo Schwarze, Karlsruhe, September 2021
 
 
 Installation
@@ -65,10 +65,15 @@ installed to the intended places.  Otherwise, put some *DIR or *NM*
 variables into "configure.local" and go back to step 4.
 
 7. Optionally run the regression suite.
-Basically, that amounts to "cd regress && ./regress.pl".
-But you should probably look at "./mandoc -l regress/regress.pl.1"
-first.  In particular, regarding Solaris systems, look at the BUGS
-section of that manual page.
+Basically, that amounts to "make regress" to do a standard regression
+run, running all tests.  For more fine-grained control,
+read "./mandoc -l regress/regress.pl.1",
+then run "cd regress && ./regress.pl" with optional arguments.
+The regression suite requires a reasonably modern Perl interpreter.
+Examples of systems that are too old to run the regression suite
+include Solaris 9, Solaris 10, and Mac OS X 10.4 Tiger.
+On Solaris 11, the suite does run, but some tests fail;
+look at the BUGS section of that manual page.
 
 8. Run "sudo make install".  If you intend to build a binary
 package using some kind of fake root mechanism, you may need a
diff --git a/contrib/mandoc/LICENSE b/contrib/mandoc/LICENSE
index 81eada0b3657..0a0fc1acd2ac 100644
--- a/contrib/mandoc/LICENSE
+++ b/contrib/mandoc/LICENSE
@@ -1,11 +1,11 @@
-$Id: LICENSE,v 1.21 2018/11/26 17:11:11 schwarze Exp $
+$Id: LICENSE,v 1.22 2021/09/19 11:02:09 schwarze Exp $
 
 With the exceptions noted below, all non-trivial files contained
 in the mandoc toolkit are protected by the Copyright of the following
 developers:
 
 Copyright (c) 2008-2012, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
-Copyright (c) 2010-2018 Ingo Schwarze <schwarze@openbsd.org>
+Copyright (c) 2010-2021 Ingo Schwarze <schwarze@openbsd.org>
 Copyright (c) 1999, 2004, 2017 Marc Espie <espie@openbsd.org>
 Copyright (c) 2009, 2010, 2011, 2012 Joerg Sonnenberger <joerg@netbsd.org>
 Copyright (c) 2013 Franco Fichtner <franco@lastsummer.de>
@@ -13,7 +13,7 @@ Copyright (c) 2014 Baptiste Daroussin <bapt@freebsd.org>
 Copyright (c) 2016 Ed Maste <emaste@freebsd.org>
 Copyright (c) 2017 Michael Stapelberg <stapelberg@debian.org>
 Copyright (c) 2017 Anthony Bentley <bentley@openbsd.org>
-Copyright (c) 1998, 2004, 2010 Todd C. Miller <Todd.Miller@courtesan.com>
+Copyright (c) 1998, 2004, 2010, 2015 Todd C. Miller <Todd.Miller@courtesan.com>
 Copyright (c) 2008, 2017 Otto Moerbeek <otto@drijf.net>
 Copyright (c) 2004 Ted Unangst <tedu@openbsd.org>
 Copyright (c) 1994 Christos Zoulas <christos@netbsd.org>
diff --git a/contrib/mandoc/Makefile b/contrib/mandoc/Makefile
index f4e29540df00..48c4741812b6 100644
--- a/contrib/mandoc/Makefile
+++ b/contrib/mandoc/Makefile
@@ -1,7 +1,7 @@
-# $Id: Makefile,v 1.530 2019/03/06 16:08:41 schwarze Exp $
+# $Id: Makefile,v 1.540 2021/09/21 11:04:40 schwarze Exp $
 #
+# Copyright (c) 2011, 2013-2021 Ingo Schwarze <schwarze@openbsd.org>
 # Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
-# Copyright (c) 2011, 2013-2019 Ingo Schwarze <schwarze@openbsd.org>
 #
 # Permission to use, copy, modify, and distribute this software for any
 # purpose with or without fee is hereby granted, provided that the above
@@ -15,11 +15,12 @@
 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
-VERSION = 1.14.5
+VERSION = 1.14.6
 
 # === LIST OF FILES ====================================================
 
-TESTSRCS	 = test-be32toh.c \
+TESTSRCS	 = test-attribute.c \
+		   test-be32toh.c \
 		   test-cmsg.c \
 		   test-dirent-namlen.c \
 		   test-EFTYPE.c \
@@ -29,6 +30,7 @@ TESTSRCS	 = test-be32toh.c \
 		   test-getsubopt.c \
 		   test-isblank.c \
 		   test-mkdtemp.c \
+		   test-mkstemps.c \
 		   test-nanosleep.c \
 		   test-noop.c \
 		   test-ntohl.c \
@@ -65,6 +67,7 @@ SRCS		 = arch.c \
 		   compat_getsubopt.c \
 		   compat_isblank.c \
 		   compat_mkdtemp.c \
+		   compat_mkstemps.c \
 		   compat_ohash.c \
 		   compat_progname.c \
 		   compat_reallocarray.c \
@@ -134,6 +137,7 @@ SRCS		 = arch.c \
 		   term_ascii.c \
 		   term_ps.c \
 		   term_tab.c \
+		   term_tag.c \
 		   tree.c
 
 DISTFILES	 = INSTALL \
@@ -209,6 +213,7 @@ DISTFILES	 = INSTALL \
 		   tbl_int.h \
 		   tbl_parse.h \
 		   term.h \
+		   term_tag.h \
 		   $(SRCS) \
 		   $(TESTSRCS)
 
@@ -245,19 +250,22 @@ LIBMANDOC_OBJS	 = $(LIBMAN_OBJS) \
 		   mandoc_xr.o \
 		   msec.o \
 		   preconv.o \
-		   read.o
+		   read.o \
+		   tag.o
 
-COMPAT_OBJS	 = compat_err.o \
+ALL_COBJS	 = compat_err.o \
 		   compat_fts.o \
 		   compat_getline.o \
 		   compat_getsubopt.o \
 		   compat_isblank.o \
 		   compat_mkdtemp.o \
+		   compat_mkstemps.o \
 		   compat_ohash.o \
 		   compat_progname.o \
 		   compat_reallocarray.o \
 		   compat_recallocarray.o \
 		   compat_strcasestr.o \
+		   compat_stringlist.o \
 		   compat_strlcat.o \
 		   compat_strlcpy.o \
 		   compat_strndup.o \
@@ -280,6 +288,7 @@ MANDOC_TERM_OBJS = eqn_term.o \
 		   term_ascii.o \
 		   term_ps.o \
 		   term_tab.o \
+		   term_tag.o \
 		   tbl_term.o
 
 DBM_OBJS	 = dbm.o \
@@ -302,7 +311,6 @@ MAIN_OBJS	 = $(MANDOC_HTML_OBJS) \
 		   mdoc_man.o \
 		   mdoc_markdown.o \
 		   out.o \
-		   tag.o \
 		   tree.o
 
 CGI_OBJS	 = $(MANDOC_HTML_OBJS) \
@@ -313,18 +321,10 @@ CGI_OBJS	 = $(MANDOC_HTML_OBJS) \
 MANDOCD_OBJS	 = $(MANDOC_HTML_OBJS) \
 		   $(MANDOC_TERM_OBJS) \
 		   mandocd.o \
-		   out.o \
-		   tag.o
+		   out.o
 
 DEMANDOC_OBJS	 = demandoc.o
 
-SOELIM_OBJS	 = soelim.o \
-		   compat_err.o \
-		   compat_getline.o \
-		   compat_progname.o \
-		   compat_reallocarray.o \
-		   compat_stringlist.o
-
 WWW_MANS	 = apropos.1.html \
 		   demandoc.1.html \
 		   man.1.html \
@@ -373,7 +373,7 @@ include Makefile.local
 
 # === DEPENDENCY HANDLING ==============================================
 
-all: mandoc demandoc soelim $(BUILD_TARGETS) Makefile.local
+all: mandoc man demandoc soelim $(BUILD_TARGETS) Makefile.local
 
 install: base-install $(INSTALL_TARGETS)
 
@@ -392,13 +392,14 @@ distclean: clean
 	rm -f Makefile.local config.h config.h.old config.log config.log.old
 
 clean:
-	rm -f libmandoc.a $(LIBMANDOC_OBJS) $(COMPAT_OBJS)
-	rm -f mandoc $(MAIN_OBJS)
+	rm -f libmandoc.a $(LIBMANDOC_OBJS) $(ALL_COBJS)
+	rm -f mandoc man $(MAIN_OBJS)
 	rm -f man.cgi $(CGI_OBJS)
 	rm -f mandocd catman catman.o $(MANDOCD_OBJS)
 	rm -f demandoc $(DEMANDOC_OBJS)
-	rm -f soelim $(SOELIM_OBJS)
+	rm -f soelim soelim.o
 	rm -f $(WWW_MANS) $(WWW_INCS) mandoc*.tar.gz mandoc*.sha256
+	rm -f Makefile.tmp1 Makefile.tmp2
 	rm -rf *.dSYM
 
 base-install: mandoc demandoc soelim
@@ -511,12 +512,15 @@ Makefile.local config.h: configure $(TESTSRCS)
 	@echo "$@ is out of date; please run ./configure"
 	@exit 1
 
-libmandoc.a: $(COMPAT_OBJS) $(LIBMANDOC_OBJS)
-	ar rs $@ $(COMPAT_OBJS) $(LIBMANDOC_OBJS)
+libmandoc.a: $(MANDOC_COBJS) $(LIBMANDOC_OBJS)
+	$(AR) rs $@ $(MANDOC_COBJS) $(LIBMANDOC_OBJS)
 
 mandoc: $(MAIN_OBJS) libmandoc.a
 	$(CC) -o $@ $(LDFLAGS) $(MAIN_OBJS) libmandoc.a $(LDADD)
 
+man: mandoc
+	$(LN) mandoc man
+
 man.cgi: $(CGI_OBJS) libmandoc.a
 	$(CC) $(STATIC) -o $@ $(LDFLAGS) $(CGI_OBJS) libmandoc.a $(LDADD)
 
@@ -529,8 +533,8 @@ catman: catman.o libmandoc.a
 demandoc: $(DEMANDOC_OBJS) libmandoc.a
 	$(CC) -o $@ $(LDFLAGS) $(DEMANDOC_OBJS) libmandoc.a $(LDADD)
 
-soelim: $(SOELIM_OBJS)
-	$(CC) -o $@ $(LDFLAGS) $(SOELIM_OBJS)
+soelim: $(SOELIM_COBJS) soelim.o
+	$(CC) -o $@ $(LDFLAGS) $(SOELIM_COBJS) soelim.o
 
 # --- maintainer targets ---
 
@@ -540,11 +544,13 @@ www-install: www
 	$(INSTALL_DATA) $(WWW_INCS) $(HTDOCDIR)/includes
 
 depend: config.h
-	mkdep -f Makefile.depend $(CFLAGS) $(SRCS)
+	./configure -depend
+	mkdep -f Makefile.tmp1 $(CFLAGS) $(SRCS)
 	perl -e 'undef $$/; $$_ = <>; s|/usr/include/\S+||g; \
 		s|\\\n||g; s|  +| |g; s| $$||mg; print;' \
-		Makefile.depend > Makefile.tmp
-	mv Makefile.tmp Makefile.depend
+		Makefile.tmp1 > Makefile.tmp2
+	rm Makefile.tmp1
+	mv Makefile.tmp2 Makefile.depend
 
 regress-distclean:
 	@find regress \
@@ -597,7 +603,7 @@ dist-install: dist
 .h.h.html:
 	highlight -I $< > $@
 
-.1.1.html .3.3.html .5.5.html .7.7.html .8.8.html: mandoc
-	mandoc -Thtml -Wwarning,stop \
+.1.1.html .3.3.html .5.5.html .7.7.html .8.8.html:
+	./mandoc -Thtml -Wwarning,stop \
 		-O 'style=/mandoc.css,man=/man/%N.%S.html;https://man.openbsd.org/%N.%S,includes=/includes/%I.html' \
 		$< > $@
diff --git a/contrib/mandoc/Makefile.depend b/contrib/mandoc/Makefile.depend
index 3540aeda822c..d5f6556c3e7e 100644
--- a/contrib/mandoc/Makefile.depend
+++ b/contrib/mandoc/Makefile.depend
@@ -9,6 +9,7 @@ compat_getline.o: compat_getline.c config.h
 compat_getsubopt.o: compat_getsubopt.c config.h
 compat_isblank.o: compat_isblank.c config.h
 compat_mkdtemp.o: compat_mkdtemp.c config.h
+compat_mkstemps.o: compat_mkstemps.c config.h
 compat_ohash.o: compat_ohash.c config.h compat_ohash.h
 compat_progname.o: compat_progname.c config.h
 compat_reallocarray.o: compat_reallocarray.c config.h
@@ -22,8 +23,8 @@ compat_strsep.o: compat_strsep.c config.h
 compat_strtonum.o: compat_strtonum.c config.h
 compat_vasprintf.o: compat_vasprintf.c config.h
 dba.o: dba.c config.h mandoc_aux.h mandoc_ohash.h compat_ohash.h mansearch.h dba_write.h dba_array.h dba.h
-dba_array.o: dba_array.c mandoc_aux.h dba_write.h dba_array.h
-dba_read.o: dba_read.c mandoc_aux.h mansearch.h dba_array.h dba.h dbm.h
+dba_array.o: dba_array.c config.h mandoc_aux.h dba_write.h dba_array.h
+dba_read.o: dba_read.c config.h mandoc_aux.h mansearch.h dba_array.h dba.h dbm.h
 dba_write.o: dba_write.c config.h dba_write.h
 dbm.o: dbm.c config.h mansearch.h dbm_map.h dbm.h
 dbm_map.o: dbm_map.c config.h mansearch.h dbm_map.h dbm.h
@@ -33,17 +34,17 @@ eqn_html.o: eqn_html.c config.h mandoc.h roff.h eqn.h out.h html.h
 eqn_term.o: eqn_term.c config.h eqn.h out.h term.h
 html.o: html.c config.h mandoc_aux.h mandoc_ohash.h compat_ohash.h mandoc.h roff.h out.h html.h manconf.h main.h
 lib.o: lib.c config.h roff.h libmdoc.h lib.in
-main.o: main.c config.h mandoc_aux.h mandoc.h mandoc_xr.h roff.h mdoc.h man.h mandoc_parse.h tag.h main.h manconf.h mansearch.h
+main.o: main.c config.h mandoc_aux.h mandoc.h mandoc_xr.h roff.h mdoc.h man.h mandoc_parse.h tag.h term_tag.h main.h manconf.h mansearch.h
 man.o: man.c config.h mandoc_aux.h mandoc.h roff.h man.h libmandoc.h roff_int.h libman.h
 man_html.o: man_html.c config.h mandoc_aux.h mandoc.h roff.h man.h out.h html.h main.h
 man_macro.o: man_macro.c config.h mandoc.h roff.h man.h libmandoc.h roff_int.h libman.h
-man_term.o: man_term.c config.h mandoc_aux.h mandoc.h roff.h man.h out.h term.h tag.h main.h
-man_validate.o: man_validate.c config.h mandoc_aux.h mandoc.h roff.h man.h libmandoc.h roff_int.h libman.h
+man_term.o: man_term.c config.h mandoc_aux.h mandoc.h roff.h man.h out.h term.h term_tag.h main.h
+man_validate.o: man_validate.c config.h mandoc_aux.h mandoc.h roff.h man.h libmandoc.h roff_int.h libman.h tag.h
 mandoc.o: mandoc.c config.h mandoc_aux.h mandoc.h roff.h libmandoc.h roff_int.h
 mandoc_aux.o: mandoc_aux.c config.h mandoc.h mandoc_aux.h
 mandoc_msg.o: mandoc_msg.c config.h mandoc.h
-mandoc_ohash.o: mandoc_ohash.c mandoc_aux.h mandoc_ohash.h compat_ohash.h
-mandoc_xr.o: mandoc_xr.c mandoc_aux.h mandoc_ohash.h compat_ohash.h mandoc_xr.h
+mandoc_ohash.o: mandoc_ohash.c config.h mandoc_aux.h mandoc_ohash.h compat_ohash.h
+mandoc_xr.o: mandoc_xr.c config.h mandoc_aux.h mandoc_ohash.h compat_ohash.h mandoc_xr.h
 mandocd.o: mandocd.c config.h mandoc.h roff.h mdoc.h man.h mandoc_parse.h main.h manconf.h
 mandocdb.o: mandocdb.c config.h compat_fts.h mandoc_aux.h mandoc_ohash.h compat_ohash.h mandoc.h roff.h mdoc.h man.h mandoc_parse.h manconf.h mansearch.h dba_array.h dba.h
 manpath.o: manpath.c config.h mandoc_aux.h mandoc.h manconf.h
@@ -53,21 +54,21 @@ mdoc_argv.o: mdoc_argv.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h libmandoc.
 mdoc_html.o: mdoc_html.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h out.h html.h main.h
 mdoc_macro.o: mdoc_macro.c config.h mandoc.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h
 mdoc_man.o: mdoc_man.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h man.h out.h main.h
-mdoc_markdown.o: mdoc_markdown.c mandoc_aux.h mandoc.h roff.h mdoc.h main.h
-mdoc_state.o: mdoc_state.c mandoc.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h
-mdoc_term.o: mdoc_term.c config.h mandoc_aux.h roff.h mdoc.h out.h term.h tag.h main.h
-mdoc_validate.o: mdoc_validate.c config.h mandoc_aux.h mandoc.h mandoc_xr.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h
+mdoc_markdown.o: mdoc_markdown.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h main.h
+mdoc_state.o: mdoc_state.c config.h mandoc.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h
+mdoc_term.o: mdoc_term.c config.h mandoc_aux.h roff.h mdoc.h out.h term.h term_tag.h main.h
+mdoc_validate.o: mdoc_validate.c config.h mandoc_aux.h mandoc.h mandoc_xr.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h tag.h
 msec.o: msec.c config.h mandoc.h libmandoc.h msec.in
-out.o: out.c config.h mandoc_aux.h tbl.h out.h
+out.o: out.c config.h mandoc_aux.h mandoc.h tbl.h out.h
 preconv.o: preconv.c config.h mandoc.h roff.h mandoc_parse.h libmandoc.h
-read.o: read.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h man.h mandoc_parse.h libmandoc.h roff_int.h
+read.o: read.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h man.h mandoc_parse.h libmandoc.h roff_int.h tag.h
 roff.o: roff.c config.h mandoc_aux.h mandoc_ohash.h compat_ohash.h mandoc.h roff.h mandoc_parse.h libmandoc.h roff_int.h tbl_parse.h eqn_parse.h predefs.in
-roff_html.o: roff_html.c mandoc.h roff.h out.h html.h
-roff_term.o: roff_term.c mandoc.h roff.h out.h term.h
-roff_validate.o: roff_validate.c mandoc.h roff.h libmandoc.h roff_int.h
+roff_html.o: roff_html.c config.h mandoc.h roff.h out.h html.h
+roff_term.o: roff_term.c config.h mandoc.h roff.h out.h term.h
+roff_validate.o: roff_validate.c config.h mandoc.h roff.h libmandoc.h roff_int.h
 soelim.o: soelim.c config.h compat_stringlist.h
 st.o: st.c config.h mandoc.h roff.h libmdoc.h
-tag.o: tag.c config.h mandoc_aux.h mandoc_ohash.h compat_ohash.h mandoc.h tag.h
+tag.o: tag.c config.h mandoc_aux.h mandoc_ohash.h compat_ohash.h roff.h mdoc.h roff_int.h tag.h
 tbl.o: tbl.c config.h mandoc_aux.h mandoc.h tbl.h libmandoc.h tbl_parse.h tbl_int.h
 tbl_data.o: tbl_data.c config.h mandoc_aux.h mandoc.h tbl.h libmandoc.h tbl_int.h
 tbl_html.o: tbl_html.c config.h mandoc.h roff.h tbl.h out.h html.h
@@ -77,5 +78,6 @@ tbl_term.o: tbl_term.c config.h mandoc.h tbl.h out.h term.h
 term.o: term.c config.h mandoc.h mandoc_aux.h out.h term.h main.h
 term_ascii.o: term_ascii.c config.h mandoc.h mandoc_aux.h out.h term.h manconf.h main.h
 term_ps.o: term_ps.c config.h mandoc_aux.h out.h term.h manconf.h main.h
-term_tab.o: term_tab.c mandoc_aux.h out.h term.h
+term_tab.o: term_tab.c config.h mandoc_aux.h out.h term.h
+term_tag.o: term_tag.c config.h mandoc.h roff.h roff_int.h tag.h term_tag.h
 tree.o: tree.c config.h mandoc.h roff.h mdoc.h man.h tbl.h eqn.h main.h
diff --git a/contrib/mandoc/NEWS b/contrib/mandoc/NEWS
index 89eb3f6fb629..634ffaf6ccfa 100644
--- a/contrib/mandoc/NEWS
+++ b/contrib/mandoc/NEWS
@@ -1,7 +1,206 @@
-$Id: NEWS,v 1.34 2019/03/10 09:32:00 schwarze Exp $
+$Id: NEWS,v 1.40 2021/09/23 18:03:00 schwarze Exp $
 
 This file lists the most important changes in the mandoc.bsd.lv distribution.
 
+Changes in version 1.14.6, released on September 23, 2021
+
+    --- MAJOR NEW FEATURES ---
+ * mdoc(7): automatic tagging improved in many respects
+ * mdoc(7): new .Tg (tag) macro to explicitly mark a place as defining a term
+ * man(7): implement some automatic tagging support
+ * man(1): let -w without argument show the manpath, like in man-db and man-1.6
+ * -T html: wrap text and phrasing elements in paragraphs unless already
+   contained in flow containers; never put them directly into sections.
+   This helps to format paragraphs with the CSS class selector .Pp.
+ * man.conf(5): remove support for the "_whatdb" configuration directive
+   that was deprecated in 2015; please use "manpath" instead
+    --- MINOR NEW FEATURES ---
+ * man(1): switch the default pager from "more -s" to "less"
+ * man(1): in the fallback code to look for manual pages without using
+   mandoc.db(5), accept files "man<one-digit-section>/<name>.<full-section>"
+   in addition to the already supported "man<full-section>/name.[01-9]*"
+ * if messages are shown and output is printed without a pager, display
+   a heads-up on stderr at the end because otherwise, users may easily
+   miss the messages
+ * man.cgi(8): add a Content-Security-Policy HTTP header
+ * man.cgi(8): switch off autocomplete and autocapitalize
+ * mandoc.css: support prefers-color-scheme: dark
+ * -T html: add meta viewport element to help mobile devices
+ * -T html -O tag: let this pass a file:// URI to the pager
+ * tbl(7): implement the "nospaces" option
+ * tbl(7) -T html: implement the "a" (em indent) layout specification
+ * tbl(7) -T html: implement the "b" (bold) and "i" (italic) layout modifiers
+ * tbl(7): support two-character font names in the layout font modifier
+ * tbl(7) -T html: support horinzontal rulers in individual cells
+ * tbl(7) -T tree: print more details about columns, options, rows, and cells
+ * roff(7): implement the .break request (break out of a .while loop)
+ * roff(7): support the CB and CI fonts in \f and .ft
+ * -T lint: new STYLE message if a file name extension contradicts .Dt/.TH
+ * -T lint: new STYLE message about overlong text lines
+ * -W style: check .Xr links along the full manpath
+    --- RELIABILITY BUGFIXES ---
+ * man(1): do not segfault if /tmp/ is not writeable
+ * man(1): do not access a NULL pointer when both -l and -w are given
+ * makewhatis(8): do not crash when a manpath directory contains
+   a symbolic link that points to a directory 
+ * man(7): fix an assertion failure caused by doubly nested next-line scopes
+ * tbl(7): fix a crash when the last column is only reached by spans
+ * tbl(7): fix a NULL pointer access in some cases of two spans on one row
+ * tbl(7) -T ascii: fix a NULL pointer access on empty data cells
+ * tbl(7) -T ascii: fix a NULL pointer access on a line next to a short row
+ * tbl(7): fix an assertion failure caused by excessive spacing modifiers
+ * tbl(7): fix an infinite loop for some overlapping horizontal spans
+ * roff(7): fix a rare case of writing one byte past the end of the input buffer
+ * roff(7): do not call abort(3) when \*[.T] is encountered
+ * roff(7): fix an assertion failure caused by a macro inside .ce .if
+ * roff(7): fix assertion failures for .ti and .po with excessive arguments
+ * roff(7): avoid near-infinte output for .ce inside explicit no-fill mode
+ * -T ascii/utf8: fix assertion failures caused by excessive spacing
+ * -T html: fix an assertion failure caused by .ft in rare situations
+ * -T man: fix an assertion failure caused by tbl(7) and eqn(7) input
+    --- PORTABILITY IMPROVEMENTS ---
+ * rename HOMEBREWDIR to READ_ALLOWED_PATH, allow it to contain more than
+   one directory, and explain how to use that for NixOS and GNU Guix Linux
+ * configure: stop trying to ask make(1) what the default compiler is
+   because that test was too fragile; just use "cc" by default
+ * configure: various simplifications and improved robustness
+ * configure: only compile compat_*.c implementations that are needed
+ * configure: provide feature tests for __attribute__(()) and mkstemps(3)
+ * compat_*: sync with upstreams for security, functionality, and style
+ * in regress.pl, avoid the non-portable options sed(1) -i and echo(1) -n
+ * in the regression suite, avoid file names that differ only by case
+    --- MINOR FUNCTIONAL IMPROVEMENTS ---
+ * man(1) -h: for pages lacking a SYNOPSIS, show the NAME section
+ * man(1): when the first argument starts with a digit, optionally
+   followed by a letter, and at least one more argument follows,
+   interpret the first argument as a section name even when additional
+   characters follow after the digit and letter
+ * man(1): with a specific section requested, try harder to find
+   the best match; use this order of preference:
+   1. The section in both the directory name and the file name matches exactly.
+   2. The section in the file name matches exactly.
+   3. The section in the directory name matches exactly.
+   4. Neither of them matches exactly.
+ * man(1): if no tags were generated at all, unlink(2) the empty tags file
+   as soon as the condition can be detected and do not pass it to less(1)
+ * makewhatis(8): handle both dangling symlinks and .so links
+   in manual page directories more gracefully
+ * man.cgi(8): for invalid queries and for valid queries returning
+   no result, return the appropriate 40x status code rather than 200
+ * mdoc(7): let .Dd concatenate all arguments and default to the empty string
+ * mdoc(7): convert ".Fl Fl" to ".Fl \-" during validation, improving -T html
+ * mdoc(7): improve output of .At 32v
+ * man(7): no longer print multiple blank lines before NAME and page footer
+ * tbl(7) -T utf8: improved rendering of horizontal lines
+ * tbl(7) -T html: in "n" cells, align by padding numbers on the right
+ * tbl(7): no longer leak tabulator settings to subsequent roff(7) code
+ * mdoc(7) -T html: for .Bl -tag, use "column-count: 1" rather
+   than "overflow: auto" to avoid the ugly side effects
+ * mdoc(7) -T html: render .Bd -unfilled in proportionally-spaced font
+ * mdoc(7) -T html: format .Nd with <span> rather than <div>
+ * mdoc(7) -T lint: do not warn about Mdocdate without an actual date
+ * mdoc(7) -T lint: do not complain about function types of the
+   form "ret_type (fname)(args)", but otherwise check names more strictly
+ * -T html: append .html suffix to temporary files to please browsers
+ * -T markdown: print a BAGARG message if called on man(7) input
+    --- MINOR BUGFIXES ---
+ * man(1): do the search for each name independently, and
+   show the results in the order of the command line argument
+ * man(1): escape shell wildcard characters in name arguments before glob(3)
+ * man(1): when asking for a single manual page by name, prefer file name
+   matches over .Dt/.TH matches over first NAME matches over later NAME
+   matches, but do not change the ordering for apropos(1) nor for man -a
+ * man(1): correctly extract the section name from the file name extension
+   of gzipped manual page files
+ * makewhatis(8): fix file type tests putting wrong data into mandoc.db(5)
+ * man.cgi(8): fix section number in the <title> element for preformatted pages
+ * tbl(7): correct handling of T& after horizontal rulers in the layout
+ * tbl(7): correct column widths if rows have different numbers of cells
+ * tbl(7): empty columns are 1n wide rather than 0n
+ * tbl(7): correctly calculate required column widths for tables containing
+   cells that horizontally span columns which contains "n" (number) formatted
+   cells on other rows
+ * tbl(7): skip escape sequences when looking for column separators
+ * eqn(7): skip whitespace before tokens
+ * roff(7): when calling an empty macro, do not clobber existing arguments
+ * roff(7): recognize \} on lines closing a macro definition request
+ * roff(7): do not throw a bogus warning for "'br\}" and similar lines
+ * roff(7): stop generating comment nodes when encountering the first content
+ * mandoc_char(7): make \0 (digit-width space) non-breaking
+ * mdoc(7) .Bl -column: parse Macro in .It "word<tab>word" Ta word Macro<eol>
+ * mdoc(7) -T html: display straight quotes, not curly quotes, for .Qq/.Qo
+ * -T html: remove some spurious line breaks, in particular inside <pre>
+ * -T html: use <br/> for a space character at the beginning of an input line
+ * -T html: use ~%d for ordinal fragment suffixes, reserve '~' for that purpose
+    --- STRUCTURAL IMPROVEMENTS ---
+ * introduce the concept of semantically transparent syntax tree nodes,
+   allowing improved decisions in various validators and formatters
+ * move some code out of the giant main() into separate functions
+   doing one well-defined task each
+ * clearly separate parser state (struct curparse) and formatter state
+   (struct outstate), don't mix them in the same struct
+ * in the HTML formatter, assert(3) that no HTML nesting violation occurs
+ * let html_close_paragraph() close any phrasing context
+    --- THANKS TO ---
+ * Anthony Bentley and Klemens Nanni (OpenBSD) for many patches and bug
+   reports, for useful discussions, and for checking patches
+ * Anton Lindqvist (OpenBSD) for two patches and a bug report
+ * Marc Espie (OpenBSD) for a patch, many bug reports, and useful discussions
+ * Lukas Epple (NixOS) for a patch, bug reports, suggesting a minor
+   portability feature, checking patches, and extensive release testing
+ * Abel Romero Perez for a patch, a bug report, and suggesting a new feature
+ * nabijaczleweli for a patch and for suggesting feature improvements
+ * Jonathan Gray (OpenBSD) for a patch and for bug reports
+ * Otto Moerbeek (OpenBSD) and Alexander Gromnitsky for a patch
+ * Armin Besirovic for a contribution to mandoc.css
+ * Jason McIntyre (OpenBSD) for manual page patches, suggesting a new feature,
+   checking many patches, and useful discussions
+ * Martin Vahlensieck for a manual page patch and reporting a code style issue
+ * Frederic Cambus and Ian Sutton (OpenBSD) for a manual page patch
+ * Jan Schreiber for many bug reports found with afl(1)
+ * G. Branden Robinson (GNU troff) for several bug reports, feature
+   suggestions, and for checking many groff patches
+ * Michael Stapelberg (Debian) for several bug reports and feature
+   suggestions, and for extensive release testing
+ * Ian Ropers, Lorenzo Beretta, and Oliver Corff for several bug reports
+   and feature suggestions
+ * Stephen Gregoratto for several bug reports
+ * Theo de Raadt (OpenBSD) for two bug reports, checking a patch,
+   and a useful discussion
+ * Thomas Klausner (NetBSD) for two bug reports and for release testing
+ * Andreas Kahari and Jason A. Donenfeld for two bug reports
+ * Soeren Tempel (Alpine Linux) for a bug report, suggesting a feature
+   improvement, and checking two patches
+ * Aman Verma, Jan Stary, and John Gardner for a bug report
+   and for suggesting a feature impovement
+ * Todd Miller (OpenBSD) for a bug report, checking a patch,
+   and a useful discussion
+ * Andrew Fresh, Brian Callahan, Christian Weisgerber, Paul de Weerd (OpenBSD),
+   Havard Eidnes, Jason Thorpe (NetBSD), Yuri Pankov (FreeBSD),
+   Bjarni Ingi Gislason, Chris Bennett, Edgar Pettijohn, Eldred Habert,
+   Jamie Landeg-Jones, Kazuo KUROI, and Wynn Wolf Arbor for a bug report
+ * Theo Buehler (OpenBSD) for suggesting two feature impovements
+   and for checking a patch
+ * Leah Neukirchen (Void Linux) for suggesting a feature impovement
+   and for release testing
+ * Colin Watson (Debian) for suggesting a feature impovement
+   and for checking groff patches
+ * Matej Cepl (SUSE Linux), Matthew Martin, Steffen Nurpmeso,
+   and Tim Baumgard for suggesting a feature impovement
+ * Christos Zoulas (NetBSD) for a report regarding portability
+ * Daniel Dickman (OpenBSD) for suggesting a portability improvement
+ * Werner Lemberg (GNU troff) and Douglas McIlroy
+   for reporting bugs in manual pages
+ * Baptiste Daroussin and Eygene Ryabinkin (FreeBSD)
+   for an additional regression test
+ * Michal Nowak for reporting several code style issues
+ * TJ Townsend (OpenBSD) for help with CSS
+ * Sevan Janiyan (NetBSD) and Robert Mustacchi (Illumos) 
+   for extensive release testing
+ * Job Snijders, Kinichiro INOGUCHI, and Martijn van Duren (OpenBSD)
+   for checking patches
+ * Bertrand Garrigues and Ralph Corderoy (GNU troff) for checking groff patches
+
 Changes in version 1.14.5, released on March 10, 2019
 
     --- MAJOR NEW FEATURES ---
diff --git a/contrib/mandoc/TODO b/contrib/mandoc/TODO
index 049e6a4f2beb..fe2059c9e5d5 100644
--- a/contrib/mandoc/TODO
+++ b/contrib/mandoc/TODO
@@ -1,6 +1,6 @@
 ************************************************************************
 * Official mandoc TODO.
-* $Id: TODO,v 1.295 2019/06/11 16:04:36 schwarze Exp $
+* $Id: TODO,v 1.319 2021/09/21 17:58:13 schwarze Exp $
 ************************************************************************
 
 Many issues are annotated for difficulty as follows:
@@ -32,6 +32,43 @@ Many issues are annotated for difficulty as follows:
 Obviously, as the issues have not been solved yet, these annotations
 are mere guesses, and some may be wrong.
 
+************************************************************************
+* assertion failures
+************************************************************************
+
+- .if n .ce in the middle of .TS data
+  afl case f1/id:000103,sig:06,src:009024+009105,op:splice,rep:2 (jes@)
+  While roff_parseln() prevents .ce and similar requests in the middle
+  of a tbl, the guard is no longer effective when the .ce is wrapped
+  in a roff block, for example a conditional.  The resulting assertion
+  has never been seen in any real-world manual page.
+  This is too dangerous to fix before release because it requires
+  reorganizing the very delicate internals of roff_parseln(),
+  which risks causing more severe bugs.
+  loc * exist *** algo *** size * imp *
+
+
+************************************************************************
+* bugs: invalid output
+************************************************************************
+
+- wrong number of layout columns in tbl(7) code generated by -T man
+  https://savannah.gnu.org/bugs/?57720
+  The reason likely is that tbl(7) does not support the -Bl -column
+  feature of not explicitly specifying the last table column.
+  loc **  exist *  algo **  size *  imp ***
+
+- eqn(7) delimiters cause conditional lines to misbehave
+  nabijaczleweli 8 Sep 2021 15:24:48 +0200
+  loc *  exist ***  algo ***  size *  imp *
+
+- roff.c, roff_expand() should not remove blanks before comments
+  to Oliver Corff, Sep 7, 2021
+  loc *  exist *  algo *  size *  imp *
+  but watch out for regressions in the high-level parsers
+  maybe it should not even remove comments? - consider T{\"
+
+
 ************************************************************************
 * missing features
 ************************************************************************
@@ -83,8 +120,39 @@ are mere guesses, and some may be wrong.
   Jan Stary 20 Apr 2019 20:16:54 +0200
   loc *  exist ***  algo ***  size **  imp *
 
+- mandoc replaces all ASCII control characters except tab and line feed
+  with '?' during input.  It would be better to replace them with
+  Unicode escapes in preconv_encode() or somewhere in the vicinity,
+  such that the already existing better replacement strings show
+  up in the output.  Emulating groff is not desirable: groff replaces
+  0x00, 0x0b, and 0x0d to 0x1f with the empty string (bad because
+  that's easy to overlook for the document author), 0x01 with '.'
+  (very confusing), and passes through 0x02 to 0x08, 0x0c, and 0x7f
+  raw (bad because that is insecure output).  Remember that 0x07 may
+  need special handling because it is sometimes used for certain
+  delimiters, so it may need handling *after* roff.c rather than before.
+  reminded by John Gardner 16 Jun 2020 14:26:28 +1000
+  Actually, more ASCII control characters than just 0x07 may need
+  later handling because they can for example be used in macro names.
+  So they may need handling after roff(7) processing.
+  pointed out by John Gardner 23 Jun 2020 18:28:08 +1000
+  more info from John Gardner 29 Jun 2020 19:54:04 +1000
+  loc **  exist **  algo **  size **  imp *
+
+- many missing features used in old groff_char(7),
+  some can possibly be supported
+  kamil at netbsd 12 Nov 2020 17:27:09 +0100 + reply
+
+- \s with arbitrary arg delimiters as already supported for other escapes
+  found following jmc@'s mail 28 Apr 2021 18:31:41 +0100
+  loc *  exist *  algo *  size *  imp *
+
 --- missing mdoc features ----------------------------------------------
 
+- .Sh and .Ss should be parsed and partially callable, see groff_mdoc(7)
+  reed at reedmedia dot net Sat, 21 Dec 2019 17:13:07 -0600
+  loc **  exist **  algo **  size **  imp *
+
 - .Bl -column .Xo support is missing
   ultimate goal:
   restore .Xr and .Dv to
@@ -153,6 +221,13 @@ are mere guesses, and some may be wrong.
 
 --- missing man features -----------------------------------------------
 
+- MANWIDTH
+  Markus Waldeck <waldeck at gmx dot de> 9 Jun 2015 05:49:56 +0200
+  Laura Morales <lauretas at mail dot com> 26 Apr 2018 08:15:55 +0200
+  Kamil Rytarowski <kamil at netbsd> 13 Nov 2020 00:19:36 +0100
+  patch from Kamil 13 Nov 2020 22:37:07 +0100
+  loc *  exist *  algo *  size *  imp *
+
 - groff_www(7) .MTO and .URL
   These macros were used by the GNU grep(1) man page.
   The groff_www(7) manual page itself uses them, too.
@@ -217,6 +292,21 @@ are mere guesses, and some may be wrong.
 
 --- missing misc features ----------------------------------------------
 
+- conisder whether man(1) fallback code in main.c/fs_*() can find files
+  like man3c/fopen.3c (illumos, Solaris) and man3p/fopen.3p (POSIX)
+  discussed with Robert Mustacchi 21 Sep 2021 10:39:40 -0700
+  loc *  exist *  algo **  size *  imp **
+
+- let makewhatis(8) follow symbolic links to dirs below READ_ALLOWED_PATH
+  this may be feasible using fts_set(FTS_FOLLOW)
+  mail to sternenseemann 19 Aug 2021 19:11:50 +0200
+  loc *  exist **  algo **  size *  imp **
+
+- -T man does not handle eqn(7) and tbl(7)
+  Stephen Gregoratto 16 Feb 2020 01:28:07 +1100
+  also https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=901636
+  loc **  exist **  algo **  size ***  imp **
+
 - man -ks 1,8 route; kn@ Jul 13, 2018 orally
 
 - italic correction (\/) in PostScript mode
@@ -291,6 +381,10 @@ are mere guesses, and some may be wrong.
 - check features of the Slackware man.conf(5) format
   Carsten Kunze  Wed, 11 Mar 2015 17:57:24 +0100
 
+- look at http://www.snake.net/software/troffcvt/  (troff to HTML)
+  mentioned by Oliver Corff  22 Jan 2021 01:36:49 +0100
+
+
 ************************************************************************
 * formatting issues: ugly output
 ************************************************************************
@@ -370,10 +464,29 @@ are mere guesses, and some may be wrong.
     add a new <</Type /Font>> block to the PDF files with /BaseFont /Courier
     and change the /Name from /F0 to the new font (/F5 (?)).
   re-reported by tb@ Mon, 16 Mar 2015 16:47:21 +0100
-  loc *  exist **  algo **  size *  imp **
+  loc **  exist **  algo **  size *  imp **
 
 --- HTML issues --------------------------------------------------------
 
+- make the HTML scaffolding customozable with -O skip=...
+  mail to Oliver Corff  3 Jun 2021 17:28:02 +0200
+  more feedback from Oliver  3 Jun 2021 18:27:56 +0200
+  more feedback from Oliver  3 Jun 2021 23:37:18 +0200
+
+- .Bd -unfilled should not use monospaced font
+  anton@  4 Mar 2021 08:19:35 +0100
+  loc **  exist *  algo *  size *  imp **
+
+- HTML formatting of .nf should avoid <br/>
+  and not close and re-open <pre> on .P
+  my mail to ports@ 27 Jun 2021 16:09:20 +0200
+  loc **  exist **  algo *  size *  imp **
+
+- get rid of the last handful of style= attributes such that
+  Content-Security-Policy: can be enabled without unsafe-inline
+  suggested by bentley@  Nov 10, 2019 at 06:02:49AM -0700
+  loc *  exist *  algo *  size *  imp **
+
 - .Bf at the beginning of a paragraph inserts a bogus 1ex horizontal
   space, see for example random(3).  Introduced in
   http://mdocml.bsd.lv/cgi-bin/cvsweb/mdoc_html.c.diff?r1=1.91&r2=1.92
@@ -386,6 +499,11 @@ are mere guesses, and some may be wrong.
   https://github.com/Debian/debiman/issues/15
   loc *  exist *  algo **  size **  imp **
 
+- space characters can end up in href= attributes, for example coming
+  from the first .Xr argument (where they make no sense, but still);
+  does this affect other characters, other source macros...?
+  Jackson Pauls  29 Aug 2017 16:56:27 +0100
+
 - The tables used to render the three-part page headers actually force
   the width of the <body> to the max-width given for <html>.
   Not yet sure how to fix that...
@@ -470,6 +588,10 @@ are mere guesses, and some may be wrong.
 * warning issues
 ************************************************************************
 
+- shorten/simplify error messages for usage errors
+  To: deraadt@ 25 Oct 2020 23:37:01 +0100
+  loc **  exist *  algo *  size **  imp ***
+
 - warn about duplicate .Sh/.Ss heads
   gre(4): Rename duplicate sections 20 Apr 2018 15:27:33 +0200
   loc *  exist *  algo *  size *  imp **
@@ -505,6 +627,10 @@ are mere guesses, and some may be wrong.
   output without intervening whitespace, in particular after a
   macro line (from the mdoclint TODO)
 
+- report double .TH in man(7) as an ERROR and let the first win
+  kristaps@  28 Mar 2021 13:30:41 +0200
+  loc *  exist *  algo *  size *  imp *
+
 - makewhatis -p complains about language subdirectories:
   /usr/local/man//ru: Unknown directory part
 
@@ -553,6 +679,9 @@ are mere guesses, and some may be wrong.
 * CGI issues
 ************************************************************************
 
+ - Inspect httpd(8) logs on man.openbsd.org and consider
+   whether logging can be improved, where bad syntax comes from,
+   and what needs to be done to get rid of COMPAT_OLDURI.
  - Enable HTTP compression by detecting gzip encoding and filtering
    output through libz.
  - Privilege separation (see OpenSSH).
@@ -562,6 +691,15 @@ are mere guesses, and some may be wrong.
 * to improve in the groff_mdoc(7) macros
 ************************************************************************
 
+- delete OS release verification from .Dx, .Fx, .Nx, .Ox etc.
+  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=629161
+  also Branden Robinson 18 Dec 2019 00:59:52 +1100
+
+- Can the distinction between .Vt and .Va be made stricter,
+  recommending .Vt extern char * Ns Va optarg ; ?
+  What about the block macro properties of .Vt in the SYNOPSIS?
+  zeurkous 25 Dec 2019 08:48:36 +0100
+
 - .Cd # arch1, arch2 in section 4 pages:
   find better way to indicate multiple architectures, maybe:
   allow .Dt vgafb 4 "macppc sparc64"
diff --git a/contrib/mandoc/apropos.1 b/contrib/mandoc/apropos.1
index 01d2a6bfa4f4..9129ae31f126 100644
--- a/contrib/mandoc/apropos.1
+++ b/contrib/mandoc/apropos.1
@@ -1,4 +1,4 @@
-.\"	$Id: apropos.1,v 1.49 2018/11/22 12:33:52 schwarze Exp $
+.\" $Id: apropos.1,v 1.51 2020/10/01 22:50:00 schwarze Exp $
 .\"
 .\" Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
 .\" Copyright (c) 2011,2012,2014,2017,2018 Ingo Schwarze <schwarze@openbsd.org>
@@ -15,7 +15,7 @@
 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 .\"
-.Dd $Mdocdate: November 22 2018 $
+.Dd $Mdocdate: October 1 2020 $
 .Dt APROPOS 1
 .Os
 .Sh NAME
@@ -73,7 +73,7 @@ would.
 If the standard output is a terminal device and
 .Fl c
 is not specified, use
-.Xr more 1
+.Xr less 1
 to paginate them.
 In
 .Fl a
@@ -340,7 +340,7 @@ types appearing in function arguments in the SYNOPSIS
 Any non-empty value of the environment variable
 .Ev MANPAGER
 is used instead of the standard pagination program,
-.Xr more 1 ;
+.Xr less 1 ;
 see
 .Xr man 1
 for details.
@@ -363,8 +363,7 @@ Specifies the pagination program to use when
 .Ev MANPAGER
 is not defined.
 If neither PAGER nor MANPAGER is defined,
-.Xr more 1
-.Fl s
+.Xr less 1
 is used.
 Only used if
 .Fl a
@@ -404,6 +403,10 @@ Search in names and descriptions using a case-sensitive regular expression:
 .Pp
 .Dl $ apropos \(aq\(tiset.?[ug]id\(aq
 .Pp
+Search for all manual pages in a given section:
+.Pp
+.Dl $ apropos \-s 9 \&.
+.Pp
 Search for manuals in the library section mentioning both the
 .Qq optind
 and the
diff --git a/contrib/mandoc/arch.c b/contrib/mandoc/arch.c
index 551c86796a21..41a23cbbc32b 100644
--- a/contrib/mandoc/arch.c
*** 14470 LINES SKIPPED ***