summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2020-03-13 00:31:07 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2020-03-13 00:31:07 +0000
commit5a8dc5b083d2bade011c458f35eb196bcc221b20 (patch)
treea0cd3ee8339d3a6ae418ef4dde4c2f1257b682e3 /regress
parentc36c15a6ac30c2c450f6854e51dd494932b163d6 (diff)
Split tagging into a validation part including prioritization
in tag.{h,c} and {mdoc,man}_validate.c and into a formatting part including command line argument checking in term_tag.{h,c}, html.c, and {mdoc|man}_{term|html}.c. Immediate functional benefits include: * Improved prioritization of automatic tags for .Em and .Sy. * Avoiding bogus automatic tags when .Em, .Fn, or .Sy are explicitly tagged. * Explicit tagging of .Er and .Fl now works in HTML output. * Automatic tagging of .IP and .TP now works in HTML output. But mainly, this patch provides clean earth to build further improvements on. Technical changes: * Main program: Write a tag file for ASCII and UTF-8 output only. * All formatters: There is no more need to delay writing the tags. * mdoc(7)+man(7) formatters: No more need for elaborate syntax tree inspection. * HTML formatter: If available, use the "string" attribute as the tag. * HTML formatter: New function to write permalinks, to reduce code duplication. Style cleanup in the vicinity while here: * mdoc(7) terminal formatter: To set up bold font for children, defer to termp_bold_pre() rather than calling term_fontpush() manually. * mdoc(7) terminal formatter: Garbage collect some duplicate functions. * mdoc(7) HTML formatter: Unify <code> handling, delete redundant functions. * Where possible, use switch statements rather than if cascades. * Get rid of some more Yoda notation. The necessity for such changes was first discussed with kn@, but i didn't bother him with a request to review the resulting -673/+782 line patch.
Diffstat (limited to 'regress')
-rw-r--r--regress/usr.bin/mandoc/Makefile.inc50
-rwxr-xr-xregress/usr.bin/mandoc/copyless14
-rw-r--r--regress/usr.bin/mandoc/man/IP/Makefile7
-rw-r--r--regress/usr.bin/mandoc/man/IP/empty.in4
-rw-r--r--regress/usr.bin/mandoc/man/IP/empty.out_ascii4
-rw-r--r--regress/usr.bin/mandoc/man/IP/empty.out_html18
-rw-r--r--regress/usr.bin/mandoc/man/IP/empty.out_lint4
-rw-r--r--regress/usr.bin/mandoc/man/IP/empty.out_tag3
-rw-r--r--regress/usr.bin/mandoc/man/IP/literal.out_html8
-rw-r--r--regress/usr.bin/mandoc/man/IP/tag.in18
-rw-r--r--regress/usr.bin/mandoc/man/IP/tag.out_ascii23
-rw-r--r--regress/usr.bin/mandoc/man/IP/tag.out_html10
-rw-r--r--regress/usr.bin/mandoc/man/IP/tag.out_tag2
-rw-r--r--regress/usr.bin/mandoc/man/TP/Makefile7
-rw-r--r--regress/usr.bin/mandoc/man/TP/literal.out_html4
-rw-r--r--regress/usr.bin/mandoc/man/TP/tag.in31
-rw-r--r--regress/usr.bin/mandoc/man/TP/tag.out_ascii29
-rw-r--r--regress/usr.bin/mandoc/man/TP/tag.out_html16
-rw-r--r--regress/usr.bin/mandoc/man/TP/tag.out_tag3
-rw-r--r--regress/usr.bin/mandoc/man/TP/vert.out_html4
-rw-r--r--regress/usr.bin/mandoc/mdoc/Cm/Makefile6
-rw-r--r--regress/usr.bin/mandoc/mdoc/Cm/tag.in21
-rw-r--r--regress/usr.bin/mandoc/mdoc/Cm/tag.out_ascii17
-rw-r--r--regress/usr.bin/mandoc/mdoc/Cm/tag.out_html9
-rw-r--r--regress/usr.bin/mandoc/mdoc/Cm/tag.out_markdown23
-rw-r--r--regress/usr.bin/mandoc/mdoc/Cm/tag.out_tag4
-rw-r--r--regress/usr.bin/mandoc/mdoc/Dv/Makefile6
-rw-r--r--regress/usr.bin/mandoc/mdoc/Dv/tag.in21
-rw-r--r--regress/usr.bin/mandoc/mdoc/Dv/tag.out_ascii17
-rw-r--r--regress/usr.bin/mandoc/mdoc/Dv/tag.out_html9
-rw-r--r--regress/usr.bin/mandoc/mdoc/Dv/tag.out_markdown23
-rw-r--r--regress/usr.bin/mandoc/mdoc/Dv/tag.out_tag4
-rw-r--r--regress/usr.bin/mandoc/mdoc/Em/Makefile6
-rw-r--r--regress/usr.bin/mandoc/mdoc/Em/tag.in23
-rw-r--r--regress/usr.bin/mandoc/mdoc/Em/tag.out_ascii17
-rw-r--r--regress/usr.bin/mandoc/mdoc/Em/tag.out_html10
-rw-r--r--regress/usr.bin/mandoc/mdoc/Em/tag.out_markdown25
-rw-r--r--regress/usr.bin/mandoc/mdoc/Em/tag.out_tag5
-rw-r--r--regress/usr.bin/mandoc/mdoc/Er/Makefile6
-rw-r--r--regress/usr.bin/mandoc/mdoc/Er/tag.in21
-rw-r--r--regress/usr.bin/mandoc/mdoc/Er/tag.out_ascii16
-rw-r--r--regress/usr.bin/mandoc/mdoc/Er/tag.out_html12
-rw-r--r--regress/usr.bin/mandoc/mdoc/Er/tag.out_markdown25
-rw-r--r--regress/usr.bin/mandoc/mdoc/Er/tag.out_tag2
-rw-r--r--regress/usr.bin/mandoc/mdoc/Ev/Makefile6
-rw-r--r--regress/usr.bin/mandoc/mdoc/Ev/tag.in21
-rw-r--r--regress/usr.bin/mandoc/mdoc/Ev/tag.out_ascii17
-rw-r--r--regress/usr.bin/mandoc/mdoc/Ev/tag.out_html9
-rw-r--r--regress/usr.bin/mandoc/mdoc/Ev/tag.out_markdown23
-rw-r--r--regress/usr.bin/mandoc/mdoc/Ev/tag.out_tag4
-rw-r--r--regress/usr.bin/mandoc/mdoc/Fl/Makefile7
-rw-r--r--regress/usr.bin/mandoc/mdoc/Fl/tag.in21
-rw-r--r--regress/usr.bin/mandoc/mdoc/Fl/tag.out_ascii17
-rw-r--r--regress/usr.bin/mandoc/mdoc/Fl/tag.out_html8
-rw-r--r--regress/usr.bin/mandoc/mdoc/Fl/tag.out_markdown23
-rw-r--r--regress/usr.bin/mandoc/mdoc/Fl/tag.out_tag4
-rw-r--r--regress/usr.bin/mandoc/mdoc/Fo/Makefile6
-rw-r--r--regress/usr.bin/mandoc/mdoc/Fo/tag.in29
-rw-r--r--regress/usr.bin/mandoc/mdoc/Fo/tag.out_ascii17
-rw-r--r--regress/usr.bin/mandoc/mdoc/Fo/tag.out_html9
-rw-r--r--regress/usr.bin/mandoc/mdoc/Fo/tag.out_markdown27
-rw-r--r--regress/usr.bin/mandoc/mdoc/Fo/tag.out_tag4
-rw-r--r--regress/usr.bin/mandoc/mdoc/Ic/Makefile6
-rw-r--r--regress/usr.bin/mandoc/mdoc/Ic/tag.in21
-rw-r--r--regress/usr.bin/mandoc/mdoc/Ic/tag.out_ascii17
-rw-r--r--regress/usr.bin/mandoc/mdoc/Ic/tag.out_html9
-rw-r--r--regress/usr.bin/mandoc/mdoc/Ic/tag.out_markdown23
-rw-r--r--regress/usr.bin/mandoc/mdoc/Ic/tag.out_tag4
-rw-r--r--regress/usr.bin/mandoc/mdoc/Li/Makefile6
-rw-r--r--regress/usr.bin/mandoc/mdoc/Li/tag.in21
-rw-r--r--regress/usr.bin/mandoc/mdoc/Li/tag.out_ascii17
-rw-r--r--regress/usr.bin/mandoc/mdoc/Li/tag.out_html9
-rw-r--r--regress/usr.bin/mandoc/mdoc/Li/tag.out_markdown23
-rw-r--r--regress/usr.bin/mandoc/mdoc/Li/tag.out_tag4
-rw-r--r--regress/usr.bin/mandoc/mdoc/Makefile4
-rw-r--r--regress/usr.bin/mandoc/mdoc/Ms/Makefile6
-rw-r--r--regress/usr.bin/mandoc/mdoc/Ms/tag.in21
-rw-r--r--regress/usr.bin/mandoc/mdoc/Ms/tag.out_ascii17
-rw-r--r--regress/usr.bin/mandoc/mdoc/Ms/tag.out_html9
-rw-r--r--regress/usr.bin/mandoc/mdoc/Ms/tag.out_markdown23
-rw-r--r--regress/usr.bin/mandoc/mdoc/Ms/tag.out_tag4
-rw-r--r--regress/usr.bin/mandoc/mdoc/No/Makefile6
-rw-r--r--regress/usr.bin/mandoc/mdoc/No/punct.out_lint1
-rw-r--r--regress/usr.bin/mandoc/mdoc/No/tag.in21
-rw-r--r--regress/usr.bin/mandoc/mdoc/No/tag.out_ascii17
-rw-r--r--regress/usr.bin/mandoc/mdoc/No/tag.out_html9
-rw-r--r--regress/usr.bin/mandoc/mdoc/No/tag.out_markdown23
-rw-r--r--regress/usr.bin/mandoc/mdoc/No/tag.out_tag4
-rw-r--r--regress/usr.bin/mandoc/mdoc/Sy/Makefile6
-rw-r--r--regress/usr.bin/mandoc/mdoc/Sy/tag.in23
-rw-r--r--regress/usr.bin/mandoc/mdoc/Sy/tag.out_ascii17
-rw-r--r--regress/usr.bin/mandoc/mdoc/Sy/tag.out_html10
-rw-r--r--regress/usr.bin/mandoc/mdoc/Sy/tag.out_markdown25
-rw-r--r--regress/usr.bin/mandoc/mdoc/Sy/tag.out_tag5
-rw-r--r--regress/usr.bin/mandoc/mdoc/Tg/Makefile8
-rw-r--r--regress/usr.bin/mandoc/mdoc/Tg/warn.in34
-rw-r--r--regress/usr.bin/mandoc/mdoc/Tg/warn.out_ascii19
-rw-r--r--regress/usr.bin/mandoc/mdoc/Tg/warn.out_html11
-rw-r--r--regress/usr.bin/mandoc/mdoc/Tg/warn.out_lint6
-rw-r--r--regress/usr.bin/mandoc/mdoc/Tg/warn.out_markdown30
-rw-r--r--regress/usr.bin/mandoc/mdoc/Tg/warn.out_tag5
101 files changed, 1302 insertions, 61 deletions
diff --git a/regress/usr.bin/mandoc/Makefile.inc b/regress/usr.bin/mandoc/Makefile.inc
index 7c89c13860e..f80ba133847 100644
--- a/regress/usr.bin/mandoc/Makefile.inc
+++ b/regress/usr.bin/mandoc/Makefile.inc
@@ -1,12 +1,13 @@
-# $OpenBSD: Makefile.inc,v 1.26 2020/01/08 10:17:14 schwarze Exp $
+# $OpenBSD: Makefile.inc,v 1.27 2020/03/13 00:31:05 schwarze Exp $
.include "Makefile.sub"
# --- programs ---
-DIFF = diff -au
-MANDOC ?= mandoc
-MOPTS ?= -mandoc
+DIFF = diff -au
+MAN ?= man
+MANDOC ?= mandoc
+MOPTS ?= -mandoc
# --- lists of targets ---
@@ -33,18 +34,17 @@ _MARKDOWNDIFFS += ${t}.diff_markdown
. endif
.endfor
+_TAGFILES = ${TAG_TARGETS:C/$/.mandoc_tag/}
+_TAGDIFFS = ${TAG_TARGETS:C/$/.diff_tag/}
+
_UTF8FILES = ${UTF8_TARGETS:C/$/.mandoc_utf8/}
_UTF8DIFFS = ${UTF8_TARGETS:C/$/.diff_utf8/}
_HTMLFILES = ${HTML_TARGETS:C/$/.mandoc_html/}
_HTMLDIFFS = ${HTML_TARGETS:C/$/.diff_html/}
-_LINTFILES =
-_LINTDIFFS =
-.for t in ${LINT_TARGETS}
-_LINTFILES += ${t}.mandoc_lint
-_LINTDIFFS += ${t}.diff_lint
-.endfor
+_LINTFILES = ${LINT_TARGETS:C/$/.mandoc_lint/}
+_LINTDIFFS = ${LINT_TARGETS:C/$/.diff_lint/}
_HTMLVALS = ${REGRESS_TARGETS:C/$/.validate_html/}
@@ -53,7 +53,7 @@ _HTMLVALS = ${REGRESS_TARGETS:C/$/.validate_html/}
# Note that bsd.regress.mk automatically adds REGRESS_TARGETS to all.
all: clean
-ascii: ascii-clean ${_ASCIIDIFFS}
+ascii: ascii-clean ${_ASCIIDIFFS} ${_TAGDIFFS}
utf8: utf8-clean ${_UTF8DIFFS}
@@ -70,10 +70,10 @@ htmlval: ${_HTMLVALS}
# --- suffix rules ---
.SUFFIXES: .diff_ascii .diff_html .diff_lint \
- .diff_man .diff_markdown .diff_utf8 \
+ .diff_man .diff_markdown .diff_tag .diff_utf8 \
.in .in_man \
.mandoc_ascii .mandoc_html .mandoc_lint \
- .mandoc_man .mandoc_markdown .mandoc_utf8 \
+ .mandoc_man .mandoc_markdown .mandoc_tag .mandoc_utf8 \
.out_ascii .out_lint .out_utf8
.in.mandoc_ascii:
@@ -82,6 +82,16 @@ htmlval: ${_HTMLVALS}
.mandoc_ascii.diff_ascii:
@${DIFF} ${.CURDIR}/${.IMPSRC:S/mandoc_ascii$/out_ascii/} ${.IMPSRC}
+.in.mandoc_tag:
+ @MANPAGER="${BSDSRCDIR}/regress/usr.bin/mandoc/copyless \
+ ${.TARGET:S/.mandoc_tag$//}" \
+ ${MAN} -l ${MOPTS} -Tascii -Ios=OpenBSD ${.IMPSRC}
+
+.mandoc_tag.diff_tag:
+ @${DIFF} ${.CURDIR}/${.IMPSRC:S/mandoc_tag$/out_tag/} ${.IMPSRC}
+ @${DIFF} ${.CURDIR}/${.IMPSRC:S/mandoc_tag$/out_ascii/} \
+ ${.IMPSRC:S/mandoc_tag$/mandoc_ascii/}
+
.in.mandoc_utf8:
@${MANDOC} ${MOPTS} -Ios=OpenBSD -Tutf8 ${.IMPSRC} > ${.TARGET}
@@ -125,7 +135,11 @@ ${t}.diff_man: ${t}.mandoc_man
. else
${t}.diff_man:
. endif
+. if empty(TAG_TARGETS:M${t})
${t}: ${t}.diff_ascii ${t}.diff_man
+. else
+${t}: ${t}.diff_tag ${t}.diff_man
+. endif
. else
${t}:
. endif
@@ -133,6 +147,10 @@ ${t}.validate_html: ${t}.in
@-${MANDOC} ${MOPTS} -Thtml ${.ALLSRC} | validate
.endfor
+.for t in ${TAG_TARGETS}
+${t}: ${t}.diff_tag
+.endfor
+
.for t in ${UTF8_TARGETS}
${t}: ${t}.diff_utf8
.endfor
@@ -157,7 +175,7 @@ clean: ${_CLEAN_TARGETS}
ascii-clean:
.if !empty(_ASCIIFILES)
- @rm -f ${_ASCIIFILES}
+ @rm -f ${_ASCIIFILES} ${_TAGFILES}
.endif
utf8-clean:
@@ -185,8 +203,8 @@ lint-clean:
@rm -f ${_LINTFILES}
.endif
-.PHONY: ${_ASCIIDIFFS} ${_UTF8DIFFS} ${_HTMLDIFFS} ${_MARKDOWNDIFFS} \
- ${_MANDIFFS} ${_LINTDIFFS} ${_HTMLVALS}
+.PHONY: ${_ASCIIDIFFS} ${_TAGDIFFS} ${_UTF8DIFFS} ${_HTMLDIFFS} \
+ ${_MARKDOWNDIFFS} ${_MANDIFFS} ${_LINTDIFFS} ${_HTMLVALS}
# ----------------------------------------------------------------------
diff --git a/regress/usr.bin/mandoc/copyless b/regress/usr.bin/mandoc/copyless
new file mode 100755
index 00000000000..a00c0009b26
--- /dev/null
+++ b/regress/usr.bin/mandoc/copyless
@@ -0,0 +1,14 @@
+#!/bin/sh
+set -e
+umask 022
+if [ "$#" -ne 4 ]; then
+ echo "$0 $*: $# args instead of 4" 1>&2
+ exit 1
+fi
+if [ "$2" != "-T" ]; then
+ echo "$0 $*: second arg is not -T" 1>&2
+ exit 1
+fi
+cut -d ' ' -f 1,3 "$3" > "$1.mandoc_tag"
+cp "$4" "$1.mandoc_ascii"
+exit 0
diff --git a/regress/usr.bin/mandoc/man/IP/Makefile b/regress/usr.bin/mandoc/man/IP/Makefile
index 70094e5fd16..8d607c62f2f 100644
--- a/regress/usr.bin/mandoc/man/IP/Makefile
+++ b/regress/usr.bin/mandoc/man/IP/Makefile
@@ -1,8 +1,9 @@
-# $OpenBSD: Makefile,v 1.10 2020/02/27 01:25:58 schwarze Exp $
+# $OpenBSD: Makefile,v 1.11 2020/03/13 00:31:05 schwarze Exp $
-REGRESS_TARGETS = bullet empty literal longhead manyargs spacing vert width
+REGRESS_TARGETS = bullet empty literal longhead manyargs spacing tag vert width
+TAG_TARGETS = empty tag
UTF8_TARGETS = bullet
LINT_TARGETS = empty
-HTML_TARGETS = bullet literal
+HTML_TARGETS = bullet empty literal tag
.include <bsd.regress.mk>
diff --git a/regress/usr.bin/mandoc/man/IP/empty.in b/regress/usr.bin/mandoc/man/IP/empty.in
index 21c42983ad5..bb814870c96 100644
--- a/regress/usr.bin/mandoc/man/IP/empty.in
+++ b/regress/usr.bin/mandoc/man/IP/empty.in
@@ -1,8 +1,9 @@
-.\" $OpenBSD: empty.in,v 1.2 2017/07/04 14:53:23 schwarze Exp $
+.\" $OpenBSD: empty.in,v 1.3 2020/03/13 00:31:05 schwarze Exp $
.TH IP-EMPTY 1 "July 17, 2012"
.SH NAME
IP-empty \- empty indented paragraphs
.SH DESCRIPTION
+BEGINTEST
regular
text
.IP
@@ -25,3 +26,4 @@ text
.RE
regular
text
+ENDTEST
diff --git a/regress/usr.bin/mandoc/man/IP/empty.out_ascii b/regress/usr.bin/mandoc/man/IP/empty.out_ascii
index 24ab17fab37..b17190ab0bd 100644
--- a/regress/usr.bin/mandoc/man/IP/empty.out_ascii
+++ b/regress/usr.bin/mandoc/man/IP/empty.out_ascii
@@ -6,7 +6,7 @@ NNAAMMEE
IP-empty - empty indented paragraphs
DDEESSCCRRIIPPTTIIOONN
- regular text
+ BEGINTEST regular text
indented text
@@ -19,7 +19,7 @@ DDEESSCCRRIIPPTTIIOONN
Empty IP is deleted, RS does not cause additional spacing:
tag indented text
- regular text
+ regular text ENDTEST
diff --git a/regress/usr.bin/mandoc/man/IP/empty.out_html b/regress/usr.bin/mandoc/man/IP/empty.out_html
new file mode 100644
index 00000000000..f2498dba85a
--- /dev/null
+++ b/regress/usr.bin/mandoc/man/IP/empty.out_html
@@ -0,0 +1,18 @@
+<dl class="Bl-tag">
+ <dt></dt>
+ <dd>indented text</dd>
+</dl>
+<p class="Pp">Empty IP is deleted:</p>
+<dl class="Bl-tag">
+ <dt id="tag1"><a class="permalink" href="#tag1">tag1</a></dt>
+ <dd></dd>
+ <dt id="tag2"><a class="permalink" href="#tag2">tag2</a></dt>
+ <dd>indented text</dd>
+</dl>
+<p class="Pp">Empty IP is deleted, RS does not cause additional spacing:</p>
+<div class="Bd-indent">
+<dl class="Bl-tag">
+ <dt id="tag"><a class="permalink" href="#tag">tag</a></dt>
+ <dd>indented text</dd>
+</dl>
+</div>
diff --git a/regress/usr.bin/mandoc/man/IP/empty.out_lint b/regress/usr.bin/mandoc/man/IP/empty.out_lint
index 6c666c88fee..3514b94f19e 100644
--- a/regress/usr.bin/mandoc/man/IP/empty.out_lint
+++ b/regress/usr.bin/mandoc/man/IP/empty.out_lint
@@ -1,2 +1,2 @@
-mandoc: empty.in:13:2: WARNING: skipping paragraph macro: IP empty
-mandoc: empty.in:20:2: WARNING: skipping paragraph macro: IP empty
+mandoc: empty.in:14:2: WARNING: skipping paragraph macro: IP empty
+mandoc: empty.in:21:2: WARNING: skipping paragraph macro: IP empty
diff --git a/regress/usr.bin/mandoc/man/IP/empty.out_tag b/regress/usr.bin/mandoc/man/IP/empty.out_tag
new file mode 100644
index 00000000000..f35f112014e
--- /dev/null
+++ b/regress/usr.bin/mandoc/man/IP/empty.out_tag
@@ -0,0 +1,3 @@
+tag1 15
+tag2 17
+tag 21
diff --git a/regress/usr.bin/mandoc/man/IP/literal.out_html b/regress/usr.bin/mandoc/man/IP/literal.out_html
index b61fc843f96..3b9cc429a3c 100644
--- a/regress/usr.bin/mandoc/man/IP/literal.out_html
+++ b/regress/usr.bin/mandoc/man/IP/literal.out_html
@@ -1,5 +1,5 @@
<dl class="Bl-tag">
- <dt>tag</dt>
+ <dt id="tag"><a class="permalink" href="#tag">tag</a></dt>
<dd>indented regular text</dd>
</dl>
<p class="Pp">new regular paragraph</p>
@@ -8,7 +8,7 @@ literal
text
</pre>
<dl class="Bl-tag">
- <dt>tag</dt>
+ <dt id="tag_2"><a class="permalink" href="#tag_2">tag</a></dt>
<dd>
<pre>
indented
@@ -32,7 +32,7 @@ literal
text
</pre>
<dl class="Bl-tag">
- <dt>tag</dt>
+ <dt id="tag_3"><a class="permalink" href="#tag_3">tag</a></dt>
<dd>
<pre>
indented
@@ -48,7 +48,7 @@ text
out of indented paragraph</a></h2>
<p class="Pp">regular text</p>
<dl class="Bl-tag">
- <dt>tag</dt>
+ <dt id="tag_4"><a class="permalink" href="#tag_4">tag</a></dt>
<dd>indented regular text
<pre>
indented
diff --git a/regress/usr.bin/mandoc/man/IP/tag.in b/regress/usr.bin/mandoc/man/IP/tag.in
new file mode 100644
index 00000000000..038fa969a3d
--- /dev/null
+++ b/regress/usr.bin/mandoc/man/IP/tag.in
@@ -0,0 +1,18 @@
+.\" $OpenBSD: tag.in,v 1.1 2020/03/13 00:31:05 schwarze Exp $
+.TH IP-TAG 1 "March 10, 2020"
+.SH NAME
+IP-tag \- automatic tagging of indented blocks
+.SH DESCRIPTION
+BEGINTEST
+initial
+text
+.IP " strong" 10n
+text
+.IP "-strong"
+text
+.IP "\&\fI \-weak\fP"
+text
+.IP " strong"
+text
+.PP
+ENDTEST
diff --git a/regress/usr.bin/mandoc/man/IP/tag.out_ascii b/regress/usr.bin/mandoc/man/IP/tag.out_ascii
new file mode 100644
index 00000000000..afd4f587fca
--- /dev/null
+++ b/regress/usr.bin/mandoc/man/IP/tag.out_ascii
@@ -0,0 +1,23 @@
+IP-TAG(1) General Commands Manual IP-TAG(1)
+
+
+
+NNAAMMEE
+ IP-tag - automatic tagging of indented blocks
+
+DDEESSCCRRIIPPTTIIOONN
+ BEGINTEST initial text
+
+ strong text
+
+ -strong text
+
+ _-_w_e_a_k text
+
+ strong text
+
+ ENDTEST
+
+
+
+OpenBSD March 10, 2020 IP-TAG(1)
diff --git a/regress/usr.bin/mandoc/man/IP/tag.out_html b/regress/usr.bin/mandoc/man/IP/tag.out_html
new file mode 100644
index 00000000000..4d25b12b6a9
--- /dev/null
+++ b/regress/usr.bin/mandoc/man/IP/tag.out_html
@@ -0,0 +1,10 @@
+<dl class="Bl-tag">
+ <dt> strong</dt>
+ <dd>text</dd>
+ <dt id="strong"><a class="permalink" href="#strong">-strong</a></dt>
+ <dd>text</dd>
+ <dt id="weak"><a class="permalink" href="#weak"><i> -weak</i></a></dt>
+ <dd>text</dd>
+ <dt> strong</dt>
+ <dd>text</dd>
+</dl>
diff --git a/regress/usr.bin/mandoc/man/IP/tag.out_tag b/regress/usr.bin/mandoc/man/IP/tag.out_tag
new file mode 100644
index 00000000000..5be038dbbdb
--- /dev/null
+++ b/regress/usr.bin/mandoc/man/IP/tag.out_tag
@@ -0,0 +1,2 @@
+strong 13
+weak 15
diff --git a/regress/usr.bin/mandoc/man/TP/Makefile b/regress/usr.bin/mandoc/man/TP/Makefile
index ca2475b0feb..9dd2fde7380 100644
--- a/regress/usr.bin/mandoc/man/TP/Makefile
+++ b/regress/usr.bin/mandoc/man/TP/Makefile
@@ -1,9 +1,10 @@
-# $OpenBSD: Makefile,v 1.16 2020/02/27 01:25:58 schwarze Exp $
+# $OpenBSD: Makefile,v 1.17 2020/03/13 00:31:05 schwarze Exp $
REGRESS_TARGETS = badarg broken double eof fill indent literal longhead
-REGRESS_TARGETS += macrotag manyargs sameline spacing vert width
+REGRESS_TARGETS += macrotag manyargs sameline spacing tag vert width
+TAG_TARGETS = tag
LINT_TARGETS = broken double eof
-HTML_TARGETS = literal vert
+HTML_TARGETS = literal tag vert
# groff-1.22.3 defects:
# - If .TP precedes .RE, the latter does not properly reset indentation.
diff --git a/regress/usr.bin/mandoc/man/TP/literal.out_html b/regress/usr.bin/mandoc/man/TP/literal.out_html
index 7f5b1c1fb5c..8b818ed8c68 100644
--- a/regress/usr.bin/mandoc/man/TP/literal.out_html
+++ b/regress/usr.bin/mandoc/man/TP/literal.out_html
@@ -1,5 +1,5 @@
<dl class="Bl-tag">
- <dt>tag</dt>
+ <dt id="tag"><a class="permalink" href="#tag">tag</a></dt>
<dd>regular indented text</dd>
</dl>
<p class="Pp">regular paragraph</p>
@@ -8,7 +8,7 @@ literal
text
</pre>
<dl class="Bl-tag">
- <dt>tag</dt>
+ <dt id="tag_2"><a class="permalink" href="#tag_2">tag</a></dt>
<dd>
<pre>
indented
diff --git a/regress/usr.bin/mandoc/man/TP/tag.in b/regress/usr.bin/mandoc/man/TP/tag.in
new file mode 100644
index 00000000000..34d1e151062
--- /dev/null
+++ b/regress/usr.bin/mandoc/man/TP/tag.in
@@ -0,0 +1,31 @@
+.\" $OpenBSD: tag.in,v 1.1 2020/03/13 00:31:05 schwarze Exp $
+.TH IP-TAG 1 "March 10, 2020"
+.SH NAME
+IP-tag \- automatic tagging of indented blocks
+.SH DESCRIPTION
+BEGINTEST
+initial
+text
+.TP 10n
+.I " plain"
+text
+.TP
+plain
+text
+.TP
+.I "plain "
+text
+.TP
+\& strong
+text
+.TP
+.B -strong
+text
+.TP
+\&\fI \-weak\fP
+text
+.TP
+.B "strong "
+text
+.PP
+ENDTEST
diff --git a/regress/usr.bin/mandoc/man/TP/tag.out_ascii b/regress/usr.bin/mandoc/man/TP/tag.out_ascii
new file mode 100644
index 00000000000..4da2efa0052
--- /dev/null
+++ b/regress/usr.bin/mandoc/man/TP/tag.out_ascii
@@ -0,0 +1,29 @@
+IP-TAG(1) General Commands Manual IP-TAG(1)
+
+
+
+NNAAMMEE
+ IP-tag - automatic tagging of indented blocks
+
+DDEESSCCRRIIPPTTIIOONN
+ BEGINTEST initial text
+
+ _p_l_a_i_n text
+
+ plain text
+
+ _p_l_a_i_n text
+
+ strong text
+
+ --ssttrroonngg text
+
+ _-_w_e_a_k text
+
+ ssttrroonngg text
+
+ ENDTEST
+
+
+
+OpenBSD March 10, 2020 IP-TAG(1)
diff --git a/regress/usr.bin/mandoc/man/TP/tag.out_html b/regress/usr.bin/mandoc/man/TP/tag.out_html
new file mode 100644
index 00000000000..3fbbe41df0a
--- /dev/null
+++ b/regress/usr.bin/mandoc/man/TP/tag.out_html
@@ -0,0 +1,16 @@
+<dl class="Bl-tag">
+ <dt><i> plain</i></dt>
+ <dd>text</dd>
+ <dt id="plain"><a class="permalink" href="#plain">plain</a></dt>
+ <dd>text</dd>
+ <dt><i>plain </i></dt>
+ <dd>text</dd>
+ <dt> strong</dt>
+ <dd>text</dd>
+ <dt id="strong"><a class="permalink" href="#strong"><b>-strong</b></a></dt>
+ <dd>text</dd>
+ <dt id="weak"><a class="permalink" href="#weak"><i> -weak</i></a></dt>
+ <dd>text</dd>
+ <dt><b>strong </b></dt>
+ <dd>text</dd>
+</dl>
diff --git a/regress/usr.bin/mandoc/man/TP/tag.out_tag b/regress/usr.bin/mandoc/man/TP/tag.out_tag
new file mode 100644
index 00000000000..88f6cff83d0
--- /dev/null
+++ b/regress/usr.bin/mandoc/man/TP/tag.out_tag
@@ -0,0 +1,3 @@
+plain 13
+strong 19
+weak 21
diff --git a/regress/usr.bin/mandoc/man/TP/vert.out_html b/regress/usr.bin/mandoc/man/TP/vert.out_html
index 7301819f916..1124ed33dd7 100644
--- a/regress/usr.bin/mandoc/man/TP/vert.out_html
+++ b/regress/usr.bin/mandoc/man/TP/vert.out_html
@@ -2,8 +2,8 @@
<section class="Sh">
<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
<dl class="Bl-tag">
- <dt>tag</dt>
+ <dt id="tag"><a class="permalink" href="#tag">tag</a></dt>
<dd>text</dd>
- <dt>tag</dt>
+ <dt id="tag_2"><a class="permalink" href="#tag_2">tag</a></dt>
<dd>text</dd>
</dl>
diff --git a/regress/usr.bin/mandoc/mdoc/Cm/Makefile b/regress/usr.bin/mandoc/mdoc/Cm/Makefile
index 6681facf14a..7bc3fc20125 100644
--- a/regress/usr.bin/mandoc/mdoc/Cm/Makefile
+++ b/regress/usr.bin/mandoc/mdoc/Cm/Makefile
@@ -1,6 +1,8 @@
-# $OpenBSD: Makefile,v 1.6 2017/05/30 16:21:08 schwarze Exp $
+# $OpenBSD: Makefile,v 1.7 2020/03/13 00:31:05 schwarze Exp $
-REGRESS_TARGETS = basic font noarg punct
+REGRESS_TARGETS = basic font noarg punct tag
+TAG_TARGETS = tag
LINT_TARGETS = noarg
+HTML_TARGETS = tag
.include <bsd.regress.mk>
diff --git a/regress/usr.bin/mandoc/mdoc/Cm/tag.in b/regress/usr.bin/mandoc/mdoc/Cm/tag.in
new file mode 100644
index 00000000000..3db1d1e0d65
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Cm/tag.in
@@ -0,0 +1,21 @@
+.\" $OpenBSD: tag.in,v 1.1 2020/03/13 00:31:05 schwarze Exp $
+.Dd $Mdocdate: March 13 2020 $
+.Dt CM-TAG 1
+.Os
+.Sh NAME
+.Nm Cm-tag
+.Nd tagging of command modifier macros
+.Sh DESCRIPTION
+BEGINTEST
+.Bl -tag -width Ds
+.It Cm one | two
+text
+.It Xo
+.Cm three
+.Xc
+text
+.El
+.Tg
+.Cm four
+.Pp
+ENDTEST
diff --git a/regress/usr.bin/mandoc/mdoc/Cm/tag.out_ascii b/regress/usr.bin/mandoc/mdoc/Cm/tag.out_ascii
new file mode 100644
index 00000000000..071408c7676
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Cm/tag.out_ascii
@@ -0,0 +1,17 @@
+CM-TAG(1) General Commands Manual CM-TAG(1)
+
+NNAAMMEE
+ CCmm--ttaagg - tagging of command modifier macros
+
+DDEESSCCRRIIPPTTIIOONN
+ BEGINTEST
+
+ oonnee | ttwwoo
+ text
+
+ tthhrreeee text
+ ffoouurr
+
+ ENDTEST
+
+OpenBSD March 13, 2020 OpenBSD
diff --git a/regress/usr.bin/mandoc/mdoc/Cm/tag.out_html b/regress/usr.bin/mandoc/mdoc/Cm/tag.out_html
new file mode 100644
index 00000000000..a140fe3e386
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Cm/tag.out_html
@@ -0,0 +1,9 @@
+<dl class="Bl-tag">
+ <dt><a class="permalink" href="#one"><code class="Cm" id="one">one</code></a>
+ |
+ <a class="permalink" href="#two"><code class="Cm" id="two">two</code></a></dt>
+ <dd>text</dd>
+ <dt><a class="permalink" href="#three"><code class="Cm" id="three">three</code></a></dt>
+ <dd>text</dd>
+</dl>
+<a class="permalink" href="#four"><code class="Cm" id="four">four</code></a>
diff --git a/regress/usr.bin/mandoc/mdoc/Cm/tag.out_markdown b/regress/usr.bin/mandoc/mdoc/Cm/tag.out_markdown
new file mode 100644
index 00000000000..893a8fe5b2b
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Cm/tag.out_markdown
@@ -0,0 +1,23 @@
+CM-TAG(1) - General Commands Manual
+
+# NAME
+
+**Cm-tag** - tagging of command modifier macros
+
+# DESCRIPTION
+
+BEGINTEST
+
+**one** | **two**
+
+> text
+
+**three**
+
+> text
+
+**four**
+
+ENDTEST
+
+OpenBSD - March 13, 2020
diff --git a/regress/usr.bin/mandoc/mdoc/Cm/tag.out_tag b/regress/usr.bin/mandoc/mdoc/Cm/tag.out_tag
new file mode 100644
index 00000000000..94f0cfb2c0d
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Cm/tag.out_tag
@@ -0,0 +1,4 @@
+one 9
+two 9
+three 12
+four 13
diff --git a/regress/usr.bin/mandoc/mdoc/Dv/Makefile b/regress/usr.bin/mandoc/mdoc/Dv/Makefile
index bbeabf5bc4f..979e182605a 100644
--- a/regress/usr.bin/mandoc/mdoc/Dv/Makefile
+++ b/regress/usr.bin/mandoc/mdoc/Dv/Makefile
@@ -1,6 +1,8 @@
-# $OpenBSD: Makefile,v 1.4 2017/03/08 22:53:35 schwarze Exp $
+# $OpenBSD: Makefile,v 1.5 2020/03/13 00:31:05 schwarze Exp $
-REGRESS_TARGETS = font noarg
+REGRESS_TARGETS = font noarg tag
+TAG_TARGETS = tag
LINT_TARGETS = noarg
+HTML_TARGETS = tag
.include <bsd.regress.mk>
diff --git a/regress/usr.bin/mandoc/mdoc/Dv/tag.in b/regress/usr.bin/mandoc/mdoc/Dv/tag.in
new file mode 100644
index 00000000000..b6c79ad14d9
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Dv/tag.in
@@ -0,0 +1,21 @@
+.\" $OpenBSD: tag.in,v 1.1 2020/03/13 00:31:05 schwarze Exp $
+.Dd $Mdocdate: March 13 2020 $
+.Dt DV-TAG 1
+.Os
+.Sh NAME
+.Nm Dv-tag
+.Nd tagging of defined variable macros
+.Sh DESCRIPTION
+BEGINTEST
+.Bl -tag -width Ds
+.It Dv one | two
+text
+.It Xo
+.Dv three
+.Xc
+text
+.El
+.Tg
+.Dv four
+.Pp
+ENDTEST
diff --git a/regress/usr.bin/mandoc/mdoc/Dv/tag.out_ascii b/regress/usr.bin/mandoc/mdoc/Dv/tag.out_ascii
new file mode 100644
index 00000000000..119e3509891
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Dv/tag.out_ascii
@@ -0,0 +1,17 @@
+DV-TAG(1) General Commands Manual DV-TAG(1)
+
+NNAAMMEE
+ DDvv--ttaagg - tagging of defined variable macros
+
+DDEESSCCRRIIPPTTIIOONN
+ BEGINTEST
+
+ one | two
+ text
+
+ three text
+ four
+
+ ENDTEST
+
+OpenBSD March 13, 2020 OpenBSD
diff --git a/regress/usr.bin/mandoc/mdoc/Dv/tag.out_html b/regress/usr.bin/mandoc/mdoc/Dv/tag.out_html
new file mode 100644
index 00000000000..cee78340802
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Dv/tag.out_html
@@ -0,0 +1,9 @@
+<dl class="Bl-tag">
+ <dt><a class="permalink" href="#one"><code class="Dv" id="one">one</code></a>
+ |
+ <a class="permalink" href="#two"><code class="Dv" id="two">two</code></a></dt>
+ <dd>text</dd>
+ <dt><a class="permalink" href="#three"><code class="Dv" id="three">three</code></a></dt>
+ <dd>text</dd>
+</dl>
+<a class="permalink" href="#four"><code class="Dv" id="four">four</code></a>
diff --git a/regress/usr.bin/mandoc/mdoc/Dv/tag.out_markdown b/regress/usr.bin/mandoc/mdoc/Dv/tag.out_markdown
new file mode 100644
index 00000000000..29b454bbd23
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Dv/tag.out_markdown
@@ -0,0 +1,23 @@
+DV-TAG(1) - General Commands Manual
+
+# NAME
+
+**Dv-tag** - tagging of defined variable macros
+
+# DESCRIPTION
+
+BEGINTEST
+
+`one` | `two`
+
+> text
+
+`three`
+
+> text
+
+`four`
+
+ENDTEST
+
+OpenBSD - March 13, 2020
diff --git a/regress/usr.bin/mandoc/mdoc/Dv/tag.out_tag b/regress/usr.bin/mandoc/mdoc/Dv/tag.out_tag
new file mode 100644
index 00000000000..94f0cfb2c0d
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Dv/tag.out_tag
@@ -0,0 +1,4 @@
+one 9
+two 9
+three 12
+four 13
diff --git a/regress/usr.bin/mandoc/mdoc/Em/Makefile b/regress/usr.bin/mandoc/mdoc/Em/Makefile
index ced9d1f0852..2b500444863 100644
--- a/regress/usr.bin/mandoc/mdoc/Em/Makefile
+++ b/regress/usr.bin/mandoc/mdoc/Em/Makefile
@@ -1,6 +1,8 @@
-# $OpenBSD: Makefile,v 1.5 2017/03/08 22:53:35 schwarze Exp $
+# $OpenBSD: Makefile,v 1.6 2020/03/13 00:31:05 schwarze Exp $
-REGRESS_TARGETS = font noarg punct
+REGRESS_TARGETS = font noarg punct tag
+TAG_TARGETS = tag
LINT_TARGETS = noarg punct
+HTML_TARGETS = tag
.include <bsd.regress.mk>
diff --git a/regress/usr.bin/mandoc/mdoc/Em/tag.in b/regress/usr.bin/mandoc/mdoc/Em/tag.in
new file mode 100644
index 00000000000..70e6eb447ec
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Em/tag.in
@@ -0,0 +1,23 @@
+.\" $OpenBSD: tag.in,v 1.1 2020/03/13 00:31:05 schwarze Exp $
+.Dd $Mdocdate: March 13 2020 $
+.Dt EM-TAG 1
+.Os
+.Sh NAME
+.Nm Em-tag
+.Nd tagging of emphasis macros
+.Sh DESCRIPTION
+BEGINTEST
+.Bl -tag -width Ds
+.It Em one | two
+text
+.It Xo
+.Em three
+.Xc
+text
+.El
+.Em four
+.Em one
+.Tg explicit
+.Em five
+.Pp
+ENDTEST
diff --git a/regress/usr.bin/mandoc/mdoc/Em/tag.out_ascii b/regress/usr.bin/mandoc/mdoc/Em/tag.out_ascii
new file mode 100644
index 00000000000..74f8212bf71
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Em/tag.out_ascii
@@ -0,0 +1,17 @@
+EM-TAG(1) General Commands Manual EM-TAG(1)
+
+NNAAMMEE
+ EEmm--ttaagg - tagging of emphasis macros
+
+DDEESSCCRRIIPPTTIIOONN
+ BEGINTEST
+
+ _o_n_e | _t_w_o
+ text
+
+ _t_h_r_e_e text
+ _f_o_u_r _o_n_e _f_i_v_e
+
+ ENDTEST
+
+OpenBSD March 13, 2020 OpenBSD
diff --git a/regress/usr.bin/mandoc/mdoc/Em/tag.out_html b/regress/usr.bin/mandoc/mdoc/Em/tag.out_html
new file mode 100644
index 00000000000..4046673f833
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Em/tag.out_html
@@ -0,0 +1,10 @@
+<dl class="Bl-tag">
+ <dt><a class="permalink" href="#one"><i class="Em" id="one">one</i></a> |
+ <a class="permalink" href="#two"><i class="Em" id="two">two</i></a></dt>
+ <dd>text</dd>
+ <dt><a class="permalink" href="#three"><i class="Em" id="three">three</i></a></dt>
+ <dd>text</dd>
+</dl>
+<a class="permalink" href="#four"><i class="Em" id="four">four</i></a>
+ <i class="Em">one</i>
+ <a class="permalink" href="#explicit"><i class="Em" id="explicit">five</i></a>
diff --git a/regress/usr.bin/mandoc/mdoc/Em/tag.out_markdown b/regress/usr.bin/mandoc/mdoc/Em/tag.out_markdown
new file mode 100644
index 00000000000..4c10715982f
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Em/tag.out_markdown
@@ -0,0 +1,25 @@
+EM-TAG(1) - General Commands Manual
+
+# NAME
+
+**Em-tag** - tagging of emphasis macros
+
+# DESCRIPTION
+
+BEGINTEST
+
+*one* | *two*
+
+> text
+
+*three*
+
+> text
+
+*four*
+*one*
+*five*
+
+ENDTEST
+
+OpenBSD - March 13, 2020
diff --git a/regress/usr.bin/mandoc/mdoc/Em/tag.out_tag b/regress/usr.bin/mandoc/mdoc/Em/tag.out_tag
new file mode 100644
index 00000000000..c2fbaf59646
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Em/tag.out_tag
@@ -0,0 +1,5 @@
+one 9
+two 9
+three 12
+four 13
+explicit 13
diff --git a/regress/usr.bin/mandoc/mdoc/Er/Makefile b/regress/usr.bin/mandoc/mdoc/Er/Makefile
index 78da864da6f..55f6cc761f8 100644
--- a/regress/usr.bin/mandoc/mdoc/Er/Makefile
+++ b/regress/usr.bin/mandoc/mdoc/Er/Makefile
@@ -1,6 +1,8 @@
-# $OpenBSD: Makefile,v 1.6 2017/03/08 22:53:35 schwarze Exp $
+# $OpenBSD: Makefile,v 1.7 2020/03/13 00:31:05 schwarze Exp $
-REGRESS_TARGETS = noarg font
+REGRESS_TARGETS = noarg font tag
+TAG_TARGETS = tag
LINT_TARGETS = noarg
+HTML_TARGETS = tag
.include <bsd.regress.mk>
diff --git a/regress/usr.bin/mandoc/mdoc/Er/tag.in b/regress/usr.bin/mandoc/mdoc/Er/tag.in
new file mode 100644
index 00000000000..4227648b69f
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Er/tag.in
@@ -0,0 +1,21 @@
+.\" $OpenBSD: tag.in,v 1.1 2020/03/13 00:31:05 schwarze Exp $
+.Dd $Mdocdate: March 13 2020 $
+.Dt ER-TAG 1
+.Os
+.Sh NAME
+.Nm Er-tag
+.Nd tagging of error number macros
+.Sh DESCRIPTION
+BEGINTEST
+.Bl -tag -width Ds
+.It Er one
+text
+.El
+.Tg
+.Er two
+.Sh ERRORS
+.Bl -tag -width Er
+.It Bq Er ENOENT
+text
+.El
+ENDTEST
diff --git a/regress/usr.bin/mandoc/mdoc/Er/tag.out_ascii b/regress/usr.bin/mandoc/mdoc/Er/tag.out_ascii
new file mode 100644
index 00000000000..62dbf9ca792
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Er/tag.out_ascii
@@ -0,0 +1,16 @@
+ER-TAG(1) General Commands Manual ER-TAG(1)
+
+NNAAMMEE
+ EErr--ttaagg - tagging of error number macros
+
+DDEESSCCRRIIPPTTIIOONN
+ BEGINTEST
+
+ one text
+ two
+
+EERRRROORRSS
+ [ENOENT] text
+ ENDTEST
+
+OpenBSD March 13, 2020 OpenBSD
diff --git a/regress/usr.bin/mandoc/mdoc/Er/tag.out_html b/regress/usr.bin/mandoc/mdoc/Er/tag.out_html
new file mode 100644
index 00000000000..a2c2978f2dc
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Er/tag.out_html
@@ -0,0 +1,12 @@
+<dl class="Bl-tag">
+ <dt><code class="Er">one</code></dt>
+ <dd>text</dd>
+</dl>
+<a class="permalink" href="#two"><code class="Er" id="two">two</code></a>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="ERRORS"><a class="permalink" href="#ERRORS">ERRORS</a></h1>
+<dl class="Bl-tag">
+ <dt>[<a class="permalink" href="#ENOENT"><code class="Er" id="ENOENT">ENOENT</code></a>]</dt>
+ <dd>text</dd>
+</dl>
diff --git a/regress/usr.bin/mandoc/mdoc/Er/tag.out_markdown b/regress/usr.bin/mandoc/mdoc/Er/tag.out_markdown
new file mode 100644
index 00000000000..d11eb4b9383
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Er/tag.out_markdown
@@ -0,0 +1,25 @@
+ER-TAG(1) - General Commands Manual
+
+# NAME
+
+**Er-tag** - tagging of error number macros
+
+# DESCRIPTION
+
+BEGINTEST
+
+`one`
+
+> text
+
+`two`
+
+# ERRORS
+
+\[`ENOENT`]
+
+> text
+
+ENDTEST
+
+OpenBSD - March 13, 2020
diff --git a/regress/usr.bin/mandoc/mdoc/Er/tag.out_tag b/regress/usr.bin/mandoc/mdoc/Er/tag.out_tag
new file mode 100644
index 00000000000..b00a67187e0
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Er/tag.out_tag
@@ -0,0 +1,2 @@
+two 10
+ENOENT 13
diff --git a/regress/usr.bin/mandoc/mdoc/Ev/Makefile b/regress/usr.bin/mandoc/mdoc/Ev/Makefile
index bbeabf5bc4f..979e182605a 100644
--- a/regress/usr.bin/mandoc/mdoc/Ev/Makefile
+++ b/regress/usr.bin/mandoc/mdoc/Ev/Makefile
@@ -1,6 +1,8 @@
-# $OpenBSD: Makefile,v 1.4 2017/03/08 22:53:35 schwarze Exp $
+# $OpenBSD: Makefile,v 1.5 2020/03/13 00:31:05 schwarze Exp $
-REGRESS_TARGETS = font noarg
+REGRESS_TARGETS = font noarg tag
+TAG_TARGETS = tag
LINT_TARGETS = noarg
+HTML_TARGETS = tag
.include <bsd.regress.mk>
diff --git a/regress/usr.bin/mandoc/mdoc/Ev/tag.in b/regress/usr.bin/mandoc/mdoc/Ev/tag.in
new file mode 100644
index 00000000000..2627fdeb9af
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Ev/tag.in
@@ -0,0 +1,21 @@
+.\" $OpenBSD: tag.in,v 1.1 2020/03/13 00:31:05 schwarze Exp $
+.Dd $Mdocdate: March 13 2020 $
+.Dt EV-TAG 1
+.Os
+.Sh NAME
+.Nm Ev-tag
+.Nd tagging of environment variable macros
+.Sh DESCRIPTION
+BEGINTEST
+.Bl -tag -width Ds
+.It Ev one | two
+text
+.It Xo
+.Ev three
+.Xc
+text
+.El
+.Tg
+.Ev four
+.Pp
+ENDTEST
diff --git a/regress/usr.bin/mandoc/mdoc/Ev/tag.out_ascii b/regress/usr.bin/mandoc/mdoc/Ev/tag.out_ascii
new file mode 100644
index 00000000000..5569d1c8e79
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Ev/tag.out_ascii
@@ -0,0 +1,17 @@
+EV-TAG(1) General Commands Manual EV-TAG(1)
+
+NNAAMMEE
+ EEvv--ttaagg - tagging of environment variable macros
+
+DDEESSCCRRIIPPTTIIOONN
+ BEGINTEST
+
+ one | two
+ text
+
+ three text
+ four
+
+ ENDTEST
+
+OpenBSD March 13, 2020 OpenBSD
diff --git a/regress/usr.bin/mandoc/mdoc/Ev/tag.out_html b/regress/usr.bin/mandoc/mdoc/Ev/tag.out_html
new file mode 100644
index 00000000000..1e1c92b9a2f
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Ev/tag.out_html
@@ -0,0 +1,9 @@
+<dl class="Bl-tag">
+ <dt><a class="permalink" href="#one"><code class="Ev" id="one">one</code></a>
+ |
+ <a class="permalink" href="#two"><code class="Ev" id="two">two</code></a></dt>
+ <dd>text</dd>
+ <dt><a class="permalink" href="#three"><code class="Ev" id="three">three</code></a></dt>
+ <dd>text</dd>
+</dl>
+<a class="permalink" href="#four"><code class="Ev" id="four">four</code></a>
diff --git a/regress/usr.bin/mandoc/mdoc/Ev/tag.out_markdown b/regress/usr.bin/mandoc/mdoc/Ev/tag.out_markdown
new file mode 100644
index 00000000000..f9a6712b19c
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Ev/tag.out_markdown
@@ -0,0 +1,23 @@
+EV-TAG(1) - General Commands Manual
+
+# NAME
+
+**Ev-tag** - tagging of environment variable macros
+
+# DESCRIPTION
+
+BEGINTEST
+
+`one` | `two`
+
+> text
+
+`three`
+
+> text
+
+`four`
+
+ENDTEST
+
+OpenBSD - March 13, 2020
diff --git a/regress/usr.bin/mandoc/mdoc/Ev/tag.out_tag b/regress/usr.bin/mandoc/mdoc/Ev/tag.out_tag
new file mode 100644
index 00000000000..94f0cfb2c0d
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Ev/tag.out_tag
@@ -0,0 +1,4 @@
+one 9
+two 9
+three 12
+four 13
diff --git a/regress/usr.bin/mandoc/mdoc/Fl/Makefile b/regress/usr.bin/mandoc/mdoc/Fl/Makefile
index e4e4a6bc958..c061adef434 100644
--- a/regress/usr.bin/mandoc/mdoc/Fl/Makefile
+++ b/regress/usr.bin/mandoc/mdoc/Fl/Makefile
@@ -1,6 +1,9 @@
-# $OpenBSD: Makefile,v 1.13 2020/02/27 01:25:58 schwarze Exp $
+# $OpenBSD: Makefile,v 1.14 2020/03/13 00:31:06 schwarze Exp $
-REGRESS_TARGETS = font multiarg noarg parsed punct spacing
+REGRESS_TARGETS = font multiarg noarg parsed punct spacing tag
+TAG_TARGETS = tag
LINT_TARGETS = punct
+HTML_TARGETS = tag
+SKIP_TMAN = tag
.include <bsd.regress.mk>
diff --git a/regress/usr.bin/mandoc/mdoc/Fl/tag.in b/regress/usr.bin/mandoc/mdoc/Fl/tag.in
new file mode 100644
index 00000000000..f7e24b9f0d2
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Fl/tag.in
@@ -0,0 +1,21 @@
+.\" $OpenBSD: tag.in,v 1.1 2020/03/13 00:31:06 schwarze Exp $
+.Dd $Mdocdate: March 13 2020 $
+.Dt FL-TAG 1
+.Os
+.Sh NAME
+.Nm Fl-tag
+.Nd tagging of command line option macros
+.Sh DESCRIPTION
+BEGINTEST
+.Bl -tag -width Ds
+.It Fl a | b
+text
+.It Xo
+.Fl c
+.Xc
+text
+.El
+.Tg
+.Fl d
+.Pp
+ENDTEST
diff --git a/regress/usr.bin/mandoc/mdoc/Fl/tag.out_ascii b/regress/usr.bin/mandoc/mdoc/Fl/tag.out_ascii
new file mode 100644
index 00000000000..4fcf803c8c0
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Fl/tag.out_ascii
@@ -0,0 +1,17 @@
+FL-TAG(1) General Commands Manual FL-TAG(1)
+
+NNAAMMEE
+ FFll--ttaagg - tagging of command line option macros
+
+DDEESSCCRRIIPPTTIIOONN
+ BEGINTEST
+
+ --aa | --bb
+ text
+
+ --cc text
+ --dd
+
+ ENDTEST
+
+OpenBSD March 13, 2020 OpenBSD
diff --git a/regress/usr.bin/mandoc/mdoc/Fl/tag.out_html b/regress/usr.bin/mandoc/mdoc/Fl/tag.out_html
new file mode 100644
index 00000000000..f67a30c04d8
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Fl/tag.out_html
@@ -0,0 +1,8 @@
+<dl class="Bl-tag">
+ <dt><a class="permalink" href="#a"><code class="Fl" id="a">-a</code></a> |
+ <a class="permalink" href="#b"><code class="Fl" id="b">-b</code></a></dt>
+ <dd>text</dd>
+ <dt><a class="permalink" href="#c"><code class="Fl" id="c">-c</code></a></dt>
+ <dd>text</dd>
+</dl>
+<a class="permalink" href="#d"><code class="Fl" id="d">-d</code></a>
diff --git a/regress/usr.bin/mandoc/mdoc/Fl/tag.out_markdown b/regress/usr.bin/mandoc/mdoc/Fl/tag.out_markdown
new file mode 100644
index 00000000000..1e7c6f14268
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Fl/tag.out_markdown
@@ -0,0 +1,23 @@
+FL-TAG(1) - General Commands Manual
+
+# NAME
+
+**Fl-tag** - tagging of command line option macros
+
+# DESCRIPTION
+
+BEGINTEST
+
+**-a** | **-b**
+
+> text
+
+**-c**
+
+> text
+
+**-d**
+
+ENDTEST
+
+OpenBSD - March 13, 2020
diff --git a/regress/usr.bin/mandoc/mdoc/Fl/tag.out_tag b/regress/usr.bin/mandoc/mdoc/Fl/tag.out_tag
new file mode 100644
index 00000000000..89a94151c0d
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Fl/tag.out_tag
@@ -0,0 +1,4 @@
+a 9
+b 9
+c 12
+d 13
diff --git a/regress/usr.bin/mandoc/mdoc/Fo/Makefile b/regress/usr.bin/mandoc/mdoc/Fo/Makefile
index 7770e9a1921..ce25ddf345a 100644
--- a/regress/usr.bin/mandoc/mdoc/Fo/Makefile
+++ b/regress/usr.bin/mandoc/mdoc/Fo/Makefile
@@ -1,8 +1,10 @@
-# $OpenBSD: Makefile,v 1.17 2020/02/27 01:25:58 schwarze Exp $
+# $OpenBSD: Makefile,v 1.18 2020/03/13 00:31:06 schwarze Exp $
REGRESS_TARGETS = basic break eos font noarg nohead
-REGRESS_TARGETS += obsolete punct section transp warn
+REGRESS_TARGETS += obsolete punct section tag transp warn
+TAG_TARGETS = tag
LINT_TARGETS = noarg nohead obsolete punct warn
+HTML_TARGETS = tag
# groff-1.22.3 defects:
# - .Fo without an argument prints unbalanced parentheses
diff --git a/regress/usr.bin/mandoc/mdoc/Fo/tag.in b/regress/usr.bin/mandoc/mdoc/Fo/tag.in
new file mode 100644
index 00000000000..29b84ffef57
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Fo/tag.in
@@ -0,0 +1,29 @@
+.\" $OpenBSD: tag.in,v 1.1 2020/03/13 00:31:06 schwarze Exp $
+.Dd $Mdocdate: March 13 2020 $
+.Dt FO-TAG 1
+.Os
+.Sh NAME
+.Nm Fo-tag
+.Nd tagging of function name macros
+.Sh DESCRIPTION
+BEGINTEST
+.Pp
+automatic:
+.Fn first
+and
+.Fn second
+.Pp
+.Fn second
+and
+.Fn first
+.Pp
+explicit:
+.Tg e3
+.Fn third
+and
+.Tg e4
+.Fo fourth
+.Fa void
+.Fc
+.Pp
+ENDTEST
diff --git a/regress/usr.bin/mandoc/mdoc/Fo/tag.out_ascii b/regress/usr.bin/mandoc/mdoc/Fo/tag.out_ascii
new file mode 100644
index 00000000000..505c0b7a2b9
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Fo/tag.out_ascii
@@ -0,0 +1,17 @@
+FO-TAG(1) General Commands Manual FO-TAG(1)
+
+NNAAMMEE
+ FFoo--ttaagg - tagging of function name macros
+
+DDEESSCCRRIIPPTTIIOONN
+ BEGINTEST
+
+ automatic: ffiirrsstt() and sseeccoonndd()
+
+ sseeccoonndd() and ffiirrsstt()
+
+ explicit: tthhiirrdd() and ffoouurrtthh(_v_o_i_d)
+
+ ENDTEST
+
+OpenBSD March 13, 2020 OpenBSD
diff --git a/regress/usr.bin/mandoc/mdoc/Fo/tag.out_html b/regress/usr.bin/mandoc/mdoc/Fo/tag.out_html
new file mode 100644
index 00000000000..b350861482e
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Fo/tag.out_html
@@ -0,0 +1,9 @@
+<p class="Pp">automatic:
+ <a class="permalink" href="#first"><code class="Fn" id="first">first</code></a>()
+ and <code class="Fn">second</code>()</p>
+<p class="Pp"><a class="permalink" href="#second"><code class="Fn" id="second">second</code></a>()
+ and <code class="Fn">first</code>()</p>
+<p class="Pp">explicit:
+ <a class="permalink" href="#e3"><code class="Fn" id="e3">third</code></a>()
+ and
+ <a class="permalink" href="#e4"><code class="Fn" id="e4">fourth</code></a>(<var class="Fa">void</var>);</p>
diff --git a/regress/usr.bin/mandoc/mdoc/Fo/tag.out_markdown b/regress/usr.bin/mandoc/mdoc/Fo/tag.out_markdown
new file mode 100644
index 00000000000..273a00d4be0
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Fo/tag.out_markdown
@@ -0,0 +1,27 @@
+FO-TAG(1) - General Commands Manual
+
+# NAME
+
+**Fo-tag** - tagging of function name macros
+
+# DESCRIPTION
+
+BEGINTEST
+
+automatic:
+**first**()
+and
+**second**()
+
+**second**()
+and
+**first**()
+
+explicit:
+**third**()
+and
+**fourth**(*void*)
+
+ENDTEST
+
+OpenBSD - March 13, 2020
diff --git a/regress/usr.bin/mandoc/mdoc/Fo/tag.out_tag b/regress/usr.bin/mandoc/mdoc/Fo/tag.out_tag
new file mode 100644
index 00000000000..2387023c8f4
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Fo/tag.out_tag
@@ -0,0 +1,4 @@
+first 9
+second 11
+e3 13
+e4 13
diff --git a/regress/usr.bin/mandoc/mdoc/Ic/Makefile b/regress/usr.bin/mandoc/mdoc/Ic/Makefile
index bba07fb34b1..4a06ee20eb4 100644
--- a/regress/usr.bin/mandoc/mdoc/Ic/Makefile
+++ b/regress/usr.bin/mandoc/mdoc/Ic/Makefile
@@ -1,6 +1,8 @@
-# $OpenBSD: Makefile,v 1.7 2017/05/30 16:21:08 schwarze Exp $
+# $OpenBSD: Makefile,v 1.8 2020/03/13 00:31:06 schwarze Exp $
-REGRESS_TARGETS = font noarg punct
+REGRESS_TARGETS = font noarg punct tag
+TAG_TARGETS = tag
LINT_TARGETS = noarg
+HTML_TARGETS = tag
.include <bsd.regress.mk>
diff --git a/regress/usr.bin/mandoc/mdoc/Ic/tag.in b/regress/usr.bin/mandoc/mdoc/Ic/tag.in
new file mode 100644
index 00000000000..9d21426e8a3
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Ic/tag.in
@@ -0,0 +1,21 @@
+.\" $OpenBSD: tag.in,v 1.1 2020/03/13 00:31:06 schwarze Exp $
+.Dd $Mdocdate: March 13 2020 $
+.Dt IC-TAG 1
+.Os
+.Sh NAME
+.Nm Ic-tag
+.Nd tagging of internal command macros
+.Sh DESCRIPTION
+BEGINTEST
+.Bl -tag -width Ds
+.It Ic one | two
+text
+.It Xo
+.Ic three
+.Xc
+text
+.El
+.Tg
+.Ic four
+.Pp
+ENDTEST
diff --git a/regress/usr.bin/mandoc/mdoc/Ic/tag.out_ascii b/regress/usr.bin/mandoc/mdoc/Ic/tag.out_ascii
new file mode 100644
index 00000000000..513b2638c51
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Ic/tag.out_ascii
@@ -0,0 +1,17 @@
+IC-TAG(1) General Commands Manual IC-TAG(1)
+
+NNAAMMEE
+ IIcc--ttaagg - tagging of internal command macros
+
+DDEESSCCRRIIPPTTIIOONN
+ BEGINTEST
+
+ oonnee | ttwwoo
+ text
+
+ tthhrreeee text
+ ffoouurr
+
+ ENDTEST
+
+OpenBSD March 13, 2020 OpenBSD
diff --git a/regress/usr.bin/mandoc/mdoc/Ic/tag.out_html b/regress/usr.bin/mandoc/mdoc/Ic/tag.out_html
new file mode 100644
index 00000000000..ad3cc1efc52
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Ic/tag.out_html
@@ -0,0 +1,9 @@
+<dl class="Bl-tag">
+ <dt><a class="permalink" href="#one"><code class="Ic" id="one">one</code></a>
+ |
+ <a class="permalink" href="#two"><code class="Ic" id="two">two</code></a></dt>
+ <dd>text</dd>
+ <dt><a class="permalink" href="#three"><code class="Ic" id="three">three</code></a></dt>
+ <dd>text</dd>
+</dl>
+<a class="permalink" href="#four"><code class="Ic" id="four">four</code></a>
diff --git a/regress/usr.bin/mandoc/mdoc/Ic/tag.out_markdown b/regress/usr.bin/mandoc/mdoc/Ic/tag.out_markdown
new file mode 100644
index 00000000000..c0f13879fba
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Ic/tag.out_markdown
@@ -0,0 +1,23 @@
+IC-TAG(1) - General Commands Manual
+
+# NAME
+
+**Ic-tag** - tagging of internal command macros
+
+# DESCRIPTION
+
+BEGINTEST
+
+**one** | **two**
+
+> text
+
+**three**
+
+> text
+
+**four**
+
+ENDTEST
+
+OpenBSD - March 13, 2020
diff --git a/regress/usr.bin/mandoc/mdoc/Ic/tag.out_tag b/regress/usr.bin/mandoc/mdoc/Ic/tag.out_tag
new file mode 100644
index 00000000000..94f0cfb2c0d
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Ic/tag.out_tag
@@ -0,0 +1,4 @@
+one 9
+two 9
+three 12
+four 13
diff --git a/regress/usr.bin/mandoc/mdoc/Li/Makefile b/regress/usr.bin/mandoc/mdoc/Li/Makefile
index 7b2a3313c5a..44dcf01cf83 100644
--- a/regress/usr.bin/mandoc/mdoc/Li/Makefile
+++ b/regress/usr.bin/mandoc/mdoc/Li/Makefile
@@ -1,6 +1,8 @@
-# $OpenBSD: Makefile,v 1.7 2018/12/21 16:58:49 schwarze Exp $
+# $OpenBSD: Makefile,v 1.8 2020/03/13 00:31:06 schwarze Exp $
-REGRESS_TARGETS = arg punct font
+REGRESS_TARGETS = arg punct font tag
+TAG_TARGETS = tag
LINT_TARGETS = punct
+HTML_TARGETS = tag
.include <bsd.regress.mk>
diff --git a/regress/usr.bin/mandoc/mdoc/Li/tag.in b/regress/usr.bin/mandoc/mdoc/Li/tag.in
new file mode 100644
index 00000000000..0ee9ce8208f
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Li/tag.in
@@ -0,0 +1,21 @@
+.\" $OpenBSD: tag.in,v 1.1 2020/03/13 00:31:06 schwarze Exp $
+.Dd $Mdocdate: March 13 2020 $
+.Dt LI-TAG 1
+.Os
+.Sh NAME
+.Nm Li-tag
+.Nd tagging of literal font macros
+.Sh DESCRIPTION
+BEGINTEST
+.Bl -tag -width Ds
+.It Li one | two
+text
+.It Xo
+.Li three
+.Xc
+text
+.El
+.Tg
+.Li four
+.Pp
+ENDTEST
diff --git a/regress/usr.bin/mandoc/mdoc/Li/tag.out_ascii b/regress/usr.bin/mandoc/mdoc/Li/tag.out_ascii
new file mode 100644
index 00000000000..e1afda6e9b4
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Li/tag.out_ascii
@@ -0,0 +1,17 @@
+LI-TAG(1) General Commands Manual LI-TAG(1)
+
+NNAAMMEE
+ LLii--ttaagg - tagging of literal font macros
+
+DDEESSCCRRIIPPTTIIOONN
+ BEGINTEST
+
+ one | two
+ text
+
+ three text
+ four
+
+ ENDTEST
+
+OpenBSD March 13, 2020 OpenBSD
diff --git a/regress/usr.bin/mandoc/mdoc/Li/tag.out_html b/regress/usr.bin/mandoc/mdoc/Li/tag.out_html
new file mode 100644
index 00000000000..3730caa6a52
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Li/tag.out_html
@@ -0,0 +1,9 @@
+<dl class="Bl-tag">
+ <dt><a class="permalink" href="#one"><code class="Li" id="one">one</code></a>
+ |
+ <a class="permalink" href="#two"><code class="Li" id="two">two</code></a></dt>
+ <dd>text</dd>
+ <dt><a class="permalink" href="#three"><code class="Li" id="three">three</code></a></dt>
+ <dd>text</dd>
+</dl>
+<a class="permalink" href="#four"><code class="Li" id="four">four</code></a>
diff --git a/regress/usr.bin/mandoc/mdoc/Li/tag.out_markdown b/regress/usr.bin/mandoc/mdoc/Li/tag.out_markdown
new file mode 100644
index 00000000000..6467e16d675
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Li/tag.out_markdown
@@ -0,0 +1,23 @@
+LI-TAG(1) - General Commands Manual
+
+# NAME
+
+**Li-tag** - tagging of literal font macros
+
+# DESCRIPTION
+
+BEGINTEST
+
+`one` | `two`
+
+> text
+
+`three`
+
+> text
+
+`four`
+
+ENDTEST
+
+OpenBSD - March 13, 2020
diff --git a/regress/usr.bin/mandoc/mdoc/Li/tag.out_tag b/regress/usr.bin/mandoc/mdoc/Li/tag.out_tag
new file mode 100644
index 00000000000..94f0cfb2c0d
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Li/tag.out_tag
@@ -0,0 +1,4 @@
+one 9
+two 9
+three 12
+four 13
diff --git a/regress/usr.bin/mandoc/mdoc/Makefile b/regress/usr.bin/mandoc/mdoc/Makefile
index 86bdcb7a2ff..83bd7fb7d40 100644
--- a/regress/usr.bin/mandoc/mdoc/Makefile
+++ b/regress/usr.bin/mandoc/mdoc/Makefile
@@ -1,9 +1,9 @@
-# $OpenBSD: Makefile,v 1.32 2017/01/11 17:39:45 schwarze Exp $
+# $OpenBSD: Makefile,v 1.33 2020/03/13 00:31:05 schwarze Exp $
SUBDIR = Ad An Ap Aq Ar At Bd Bf Bk Bl Brq Bx Cd Cm
SUBDIR += D1 Db Dd Dl Dq Dt Dv Em Eo Er Ev Ex Fd Fl Fo Ft Ic In Lb Li Lk
SUBDIR += Ms Mt Nd Nm No Ns Oo Op Os Ox Pa Pf Pp Qq Rs Rv
-SUBDIR += Sh Sm Sq St Sx Sy Tn Ud Ux Va Vt Xr blank break
+SUBDIR += Sh Sm Sq St Sx Sy Tg Tn Ud Ux Va Vt Xr blank break
.include "../Makefile.sub"
.include <bsd.subdir.mk>
diff --git a/regress/usr.bin/mandoc/mdoc/Ms/Makefile b/regress/usr.bin/mandoc/mdoc/Ms/Makefile
index 78da864da6f..defbb29481a 100644
--- a/regress/usr.bin/mandoc/mdoc/Ms/Makefile
+++ b/regress/usr.bin/mandoc/mdoc/Ms/Makefile
@@ -1,6 +1,8 @@
-# $OpenBSD: Makefile,v 1.6 2017/03/08 22:53:35 schwarze Exp $
+# $OpenBSD: Makefile,v 1.7 2020/03/13 00:31:06 schwarze Exp $
-REGRESS_TARGETS = noarg font
+REGRESS_TARGETS = noarg font tag
+TAG_TARGET = tag
LINT_TARGETS = noarg
+HTML_TARGET = tag
.include <bsd.regress.mk>
diff --git a/regress/usr.bin/mandoc/mdoc/Ms/tag.in b/regress/usr.bin/mandoc/mdoc/Ms/tag.in
new file mode 100644
index 00000000000..da65a07e51e
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Ms/tag.in
@@ -0,0 +1,21 @@
+.\" $OpenBSD: tag.in,v 1.1 2020/03/13 00:31:06 schwarze Exp $
+.Dd $Mdocdate: March 13 2020 $
+.Dt MS-TAG 1
+.Os
+.Sh NAME
+.Nm Ms-tag
+.Nd tagging of mathematical symbol macros
+.Sh DESCRIPTION
+BEGINTEST
+.Bl -tag -width Ds
+.It Ms one | two
+text
+.It Xo
+.Ms three
+.Xc
+text
+.El
+.Tg
+.Ms four
+.Pp
+ENDTEST
diff --git a/regress/usr.bin/mandoc/mdoc/Ms/tag.out_ascii b/regress/usr.bin/mandoc/mdoc/Ms/tag.out_ascii
new file mode 100644
index 00000000000..2d06f4bffcb
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Ms/tag.out_ascii
@@ -0,0 +1,17 @@
+MS-TAG(1) General Commands Manual MS-TAG(1)
+
+NNAAMMEE
+ MMss--ttaagg - tagging of mathematical symbol macros
+
+DDEESSCCRRIIPPTTIIOONN
+ BEGINTEST
+
+ oonnee | ttwwoo
+ text
+
+ tthhrreeee text
+ ffoouurr
+
+ ENDTEST
+
+OpenBSD March 13, 2020 OpenBSD
diff --git a/regress/usr.bin/mandoc/mdoc/Ms/tag.out_html b/regress/usr.bin/mandoc/mdoc/Ms/tag.out_html
new file mode 100644
index 00000000000..a140fe3e386
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Ms/tag.out_html
@@ -0,0 +1,9 @@
+<dl class="Bl-tag">
+ <dt><a class="permalink" href="#one"><code class="Cm" id="one">one</code></a>
+ |
+ <a class="permalink" href="#two"><code class="Cm" id="two">two</code></a></dt>
+ <dd>text</dd>
+ <dt><a class="permalink" href="#three"><code class="Cm" id="three">three</code></a></dt>
+ <dd>text</dd>
+</dl>
+<a class="permalink" href="#four"><code class="Cm" id="four">four</code></a>
diff --git a/regress/usr.bin/mandoc/mdoc/Ms/tag.out_markdown b/regress/usr.bin/mandoc/mdoc/Ms/tag.out_markdown
new file mode 100644
index 00000000000..055c386002c
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Ms/tag.out_markdown
@@ -0,0 +1,23 @@
+MS-TAG(1) - General Commands Manual
+
+# NAME
+
+**Ms-tag** - tagging of mathematical symbol macros
+
+# DESCRIPTION
+
+BEGINTEST
+
+**one** | **two**
+
+> text
+
+**three**
+
+> text
+
+**four**
+
+ENDTEST
+
+OpenBSD - March 13, 2020
diff --git a/regress/usr.bin/mandoc/mdoc/Ms/tag.out_tag b/regress/usr.bin/mandoc/mdoc/Ms/tag.out_tag
new file mode 100644
index 00000000000..94f0cfb2c0d
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Ms/tag.out_tag
@@ -0,0 +1,4 @@
+one 9
+two 9
+three 12
+four 13
diff --git a/regress/usr.bin/mandoc/mdoc/No/Makefile b/regress/usr.bin/mandoc/mdoc/No/Makefile
index 1187d98bff1..35aa4e1e19d 100644
--- a/regress/usr.bin/mandoc/mdoc/No/Makefile
+++ b/regress/usr.bin/mandoc/mdoc/No/Makefile
@@ -1,6 +1,8 @@
-# $OpenBSD: Makefile,v 1.6 2017/03/08 22:53:35 schwarze Exp $
+# $OpenBSD: Makefile,v 1.7 2020/03/13 00:31:06 schwarze Exp $
-REGRESS_TARGETS = punct spacing
+REGRESS_TARGETS = punct spacing tag
+TAG_TARGETS = tag
LINT_TARGETS = punct
+HTML_TARGETS = tag
.include <bsd.regress.mk>
diff --git a/regress/usr.bin/mandoc/mdoc/No/punct.out_lint b/regress/usr.bin/mandoc/mdoc/No/punct.out_lint
index e046da6a10c..6a65c3b4034 100644
--- a/regress/usr.bin/mandoc/mdoc/No/punct.out_lint
+++ b/regress/usr.bin/mandoc/mdoc/No/punct.out_lint
@@ -23,3 +23,4 @@ mandoc: punct.in:72:7: WARNING: skipping empty macro: No
mandoc: punct.in:75:7: WARNING: skipping empty macro: No
mandoc: punct.in:76:7: WARNING: skipping empty macro: No
mandoc: punct.in:84:2: WARNING: skipping empty macro: No
+mandoc: punct.in:87:6: STYLE: no blank before trailing delimiter: No a.
diff --git a/regress/usr.bin/mandoc/mdoc/No/tag.in b/regress/usr.bin/mandoc/mdoc/No/tag.in
new file mode 100644
index 00000000000..a9d4415f799
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/No/tag.in
@@ -0,0 +1,21 @@
+.\" $OpenBSD: tag.in,v 1.1 2020/03/13 00:31:06 schwarze Exp $
+.Dd $Mdocdate: March 13 2020 $
+.Dt NO-TAG 1
+.Os
+.Sh NAME
+.Nm No-tag
+.Nd tagging of normal font macros
+.Sh DESCRIPTION
+BEGINTEST
+.Bl -tag -width Ds
+.It No one | two
+text
+.It Xo
+.No three
+.Xc
+text
+.El
+.Tg
+.No four
+.Pp
+ENDTEST
diff --git a/regress/usr.bin/mandoc/mdoc/No/tag.out_ascii b/regress/usr.bin/mandoc/mdoc/No/tag.out_ascii
new file mode 100644
index 00000000000..44481b02a4e
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/No/tag.out_ascii
@@ -0,0 +1,17 @@
+NO-TAG(1) General Commands Manual NO-TAG(1)
+
+NNAAMMEE
+ NNoo--ttaagg - tagging of normal font macros
+
+DDEESSCCRRIIPPTTIIOONN
+ BEGINTEST
+
+ one | two
+ text
+
+ three text
+ four
+
+ ENDTEST
+
+OpenBSD March 13, 2020 OpenBSD
diff --git a/regress/usr.bin/mandoc/mdoc/No/tag.out_html b/regress/usr.bin/mandoc/mdoc/No/tag.out_html
new file mode 100644
index 00000000000..32696917362
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/No/tag.out_html
@@ -0,0 +1,9 @@
+<dl class="Bl-tag">
+ <dt><a class="permalink" href="#one"><span class="No" id="one">one</span></a>
+ |
+ <a class="permalink" href="#two"><span class="No" id="two">two</span></a></dt>
+ <dd>text</dd>
+ <dt><a class="permalink" href="#three"><span class="No" id="three">three</span></a></dt>
+ <dd>text</dd>
+</dl>
+<a class="permalink" href="#four"><span class="No" id="four">four</span></a>
diff --git a/regress/usr.bin/mandoc/mdoc/No/tag.out_markdown b/regress/usr.bin/mandoc/mdoc/No/tag.out_markdown
new file mode 100644
index 00000000000..1590c01059f
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/No/tag.out_markdown
@@ -0,0 +1,23 @@
+NO-TAG(1) - General Commands Manual
+
+# NAME
+
+**No-tag** - tagging of normal font macros
+
+# DESCRIPTION
+
+BEGINTEST
+
+one | two
+
+> text
+
+three
+
+> text
+
+four
+
+ENDTEST
+
+OpenBSD - March 13, 2020
diff --git a/regress/usr.bin/mandoc/mdoc/No/tag.out_tag b/regress/usr.bin/mandoc/mdoc/No/tag.out_tag
new file mode 100644
index 00000000000..94f0cfb2c0d
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/No/tag.out_tag
@@ -0,0 +1,4 @@
+one 9
+two 9
+three 12
+four 13
diff --git a/regress/usr.bin/mandoc/mdoc/Sy/Makefile b/regress/usr.bin/mandoc/mdoc/Sy/Makefile
index 6a72abfa5ec..752d1382597 100644
--- a/regress/usr.bin/mandoc/mdoc/Sy/Makefile
+++ b/regress/usr.bin/mandoc/mdoc/Sy/Makefile
@@ -1,6 +1,8 @@
-# $OpenBSD: Makefile,v 1.7 2017/03/08 22:53:36 schwarze Exp $
+# $OpenBSD: Makefile,v 1.8 2020/03/13 00:31:06 schwarze Exp $
-REGRESS_TARGETS = noarg font punct
+REGRESS_TARGETS = noarg font punct tag
+TAG_TARGETS = tag
LINT_TARGETS = noarg punct
+HTML_TARGETS = tag
.include <bsd.regress.mk>
diff --git a/regress/usr.bin/mandoc/mdoc/Sy/tag.in b/regress/usr.bin/mandoc/mdoc/Sy/tag.in
new file mode 100644
index 00000000000..1294e17da7d
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Sy/tag.in
@@ -0,0 +1,23 @@
+.\" $OpenBSD: tag.in,v 1.1 2020/03/13 00:31:06 schwarze Exp $
+.Dd $Mdocdate: March 13 2020 $
+.Dt SY-TAG 1
+.Os
+.Sh NAME
+.Nm Sy-tag
+.Nd tagging of symbolic font macros
+.Sh DESCRIPTION
+BEGINTEST
+.Bl -tag -width Ds
+.It Sy one | two
+text
+.It Xo
+.Sy three
+.Xc
+text
+.El
+.Sy four
+.Sy one
+.Tg explicit
+.Sy five
+.Pp
+ENDTEST
diff --git a/regress/usr.bin/mandoc/mdoc/Sy/tag.out_ascii b/regress/usr.bin/mandoc/mdoc/Sy/tag.out_ascii
new file mode 100644
index 00000000000..3b89cb4157b
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Sy/tag.out_ascii
@@ -0,0 +1,17 @@
+SY-TAG(1) General Commands Manual SY-TAG(1)
+
+NNAAMMEE
+ SSyy--ttaagg - tagging of symbolic font macros
+
+DDEESSCCRRIIPPTTIIOONN
+ BEGINTEST
+
+ oonnee | ttwwoo
+ text
+
+ tthhrreeee text
+ ffoouurr oonnee ffiivvee
+
+ ENDTEST
+
+OpenBSD March 13, 2020 OpenBSD
diff --git a/regress/usr.bin/mandoc/mdoc/Sy/tag.out_html b/regress/usr.bin/mandoc/mdoc/Sy/tag.out_html
new file mode 100644
index 00000000000..69276a1883b
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Sy/tag.out_html
@@ -0,0 +1,10 @@
+<dl class="Bl-tag">
+ <dt><a class="permalink" href="#one"><b class="Sy" id="one">one</b></a> |
+ <a class="permalink" href="#two"><b class="Sy" id="two">two</b></a></dt>
+ <dd>text</dd>
+ <dt><a class="permalink" href="#three"><b class="Sy" id="three">three</b></a></dt>
+ <dd>text</dd>
+</dl>
+<a class="permalink" href="#four"><b class="Sy" id="four">four</b></a>
+ <b class="Sy">one</b>
+ <a class="permalink" href="#explicit"><b class="Sy" id="explicit">five</b></a>
diff --git a/regress/usr.bin/mandoc/mdoc/Sy/tag.out_markdown b/regress/usr.bin/mandoc/mdoc/Sy/tag.out_markdown
new file mode 100644
index 00000000000..5382a5e254f
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Sy/tag.out_markdown
@@ -0,0 +1,25 @@
+SY-TAG(1) - General Commands Manual
+
+# NAME
+
+**Sy-tag** - tagging of symbolic font macros
+
+# DESCRIPTION
+
+BEGINTEST
+
+**one** | **two**
+
+> text
+
+**three**
+
+> text
+
+**four**
+**one**
+**five**
+
+ENDTEST
+
+OpenBSD - March 13, 2020
diff --git a/regress/usr.bin/mandoc/mdoc/Sy/tag.out_tag b/regress/usr.bin/mandoc/mdoc/Sy/tag.out_tag
new file mode 100644
index 00000000000..c2fbaf59646
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Sy/tag.out_tag
@@ -0,0 +1,5 @@
+one 9
+two 9
+three 12
+four 13
+explicit 13
diff --git a/regress/usr.bin/mandoc/mdoc/Tg/Makefile b/regress/usr.bin/mandoc/mdoc/Tg/Makefile
new file mode 100644
index 00000000000..7f5387660af
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Tg/Makefile
@@ -0,0 +1,8 @@
+# $OpenBSD: Makefile,v 1.1 2020/03/13 00:31:06 schwarze Exp $
+
+REGRESS_TARGETS = warn
+TAG_TARGETS = warn
+LINT_TARGETS = warn
+HTML_TARGETS = warn
+
+.include <bsd.regress.mk>
diff --git a/regress/usr.bin/mandoc/mdoc/Tg/warn.in b/regress/usr.bin/mandoc/mdoc/Tg/warn.in
new file mode 100644
index 00000000000..e36f4506150
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Tg/warn.in
@@ -0,0 +1,34 @@
+.\" $OpenBSD: warn.in,v 1.1 2020/03/13 00:31:06 schwarze Exp $
+.Dd $Mdocdate: March 13 2020 $
+.Dt TG-WARN 1
+.Os
+.Sh NAME
+.Nm Tg-warn
+.Nd warnings about tagging macros
+.Sh DESCRIPTION
+BEGINTEST
+.Pp
+.Tg start
+initial
+text
+.Tg
+.Ic macro
+.Tg "" ignored arguments
+too many
+.Tg \&badstart
+badstart
+.Tg badend\&
+badend
+.Tg "white space"
+whitespace
+.Tg sub
+.Tg double
+.Ss Subsection
+subtext
+.Tg examples
+.Sh EXAMPLES
+example
+text
+.Pp
+ENDTEST
+.Tg
diff --git a/regress/usr.bin/mandoc/mdoc/Tg/warn.out_ascii b/regress/usr.bin/mandoc/mdoc/Tg/warn.out_ascii
new file mode 100644
index 00000000000..8dee9aed406
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Tg/warn.out_ascii
@@ -0,0 +1,19 @@
+TG-WARN(1) General Commands Manual TG-WARN(1)
+
+NNAAMMEE
+ TTgg--wwaarrnn - warnings about tagging macros
+
+DDEESSCCRRIIPPTTIIOONN
+ BEGINTEST
+
+ initial text mmaaccrroo too many badstart badend whitespace
+
+ SSuubbsseeccttiioonn
+ subtext
+
+EEXXAAMMPPLLEESS
+ example text
+
+ ENDTEST
+
+OpenBSD March 13, 2020 OpenBSD
diff --git a/regress/usr.bin/mandoc/mdoc/Tg/warn.out_html b/regress/usr.bin/mandoc/mdoc/Tg/warn.out_html
new file mode 100644
index 00000000000..b4d3cf74c57
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Tg/warn.out_html
@@ -0,0 +1,11 @@
+<p class="Pp"><mark id="start"></mark>initial text
+ <a class="permalink" href="#macro"><code class="Ic" id="macro">macro</code></a>
+ too many badstart badend whitespace <mark id="sub"></mark></p>
+<section class="Ss">
+<h2 class="Ss" id="double"><a class="permalink" href="#double">Subsection</a></h2>
+<p class="Pp">subtext</p>
+</section>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="examples"><a class="permalink" href="#examples">EXAMPLES</a></h1>
+<p class="Pp">example text</p>
diff --git a/regress/usr.bin/mandoc/mdoc/Tg/warn.out_lint b/regress/usr.bin/mandoc/mdoc/Tg/warn.out_lint
new file mode 100644
index 00000000000..39c1f541fbc
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Tg/warn.out_lint
@@ -0,0 +1,6 @@
+mandoc: warn.in:16:2: WARNING: skipping empty macro: Tg
+mandoc: warn.in:16:8: ERROR: skipping excess arguments: Tg ... ignored
+mandoc: warn.in:18:5: ERROR: skipping tag containing whitespace: Tg \&badstart
+mandoc: warn.in:20:11: ERROR: skipping tag containing whitespace: Tg badend\&
+mandoc: warn.in:22:10: ERROR: skipping tag containing whitespace: Tg white space
+mandoc: warn.in:34:2: WARNING: skipping empty macro: Tg
diff --git a/regress/usr.bin/mandoc/mdoc/Tg/warn.out_markdown b/regress/usr.bin/mandoc/mdoc/Tg/warn.out_markdown
new file mode 100644
index 00000000000..872044244a7
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Tg/warn.out_markdown
@@ -0,0 +1,30 @@
+TG-WARN(1) - General Commands Manual
+
+# NAME
+
+**Tg-warn** - warnings about tagging macros
+
+# DESCRIPTION
+
+BEGINTEST
+
+initial
+text
+**macro**
+too many
+badstart
+badend
+whitespace
+
+## Subsection
+
+subtext
+
+# EXAMPLES
+
+example
+text
+
+ENDTEST
+
+OpenBSD - March 13, 2020
diff --git a/regress/usr.bin/mandoc/mdoc/Tg/warn.out_tag b/regress/usr.bin/mandoc/mdoc/Tg/warn.out_tag
new file mode 100644
index 00000000000..e1fc141c346
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Tg/warn.out_tag
@@ -0,0 +1,5 @@
+start 9
+macro 9
+sub 9
+double 11
+examples 14