* mdocml: if .in is used inside the .TP head, it's always relative
@ 2017-06-17 16:47 schwarze
0 siblings, 0 replies; only message in thread
From: schwarze @ 2017-06-17 16:47 UTC (permalink / raw)
To: source
Log Message:
-----------
if .in is used inside the .TP head, it's always relative
Modified Files:
--------------
mdocml:
man_macro.c
man_validate.c
mdocml/regress/man/TP:
Makefile
Added Files:
-----------
mdocml/regress/man/TP:
indent.in
indent.out_ascii
Revision Data
-------------
Index: man_macro.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/man_macro.c,v
retrieving revision 1.121
retrieving revision 1.122
diff -Lman_macro.c -Lman_macro.c -u -p -r1.121 -r1.122
--- man_macro.c
+++ man_macro.c
@@ -69,7 +69,7 @@ const struct man_macro __man_macros[MAN_
{ in_line_eoln, 0 }, /* UC */
{ in_line_eoln, MAN_NSCOPED }, /* PD */
{ in_line_eoln, 0 }, /* AT */
- { in_line_eoln, 0 }, /* in */
+ { in_line_eoln, MAN_NSCOPED }, /* in */
{ in_line_eoln, 0 }, /* OP */
{ in_line_eoln, MAN_BSCOPE }, /* EX */
{ in_line_eoln, MAN_BSCOPE }, /* EE */
Index: man_validate.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/man_validate.c,v
retrieving revision 1.128
retrieving revision 1.129
diff -Lman_validate.c -Lman_validate.c -u -p -r1.128 -r1.129
--- man_validate.c
+++ man_validate.c
@@ -47,11 +47,12 @@ static void check_text(CHKARGS);
static void post_AT(CHKARGS);
static void post_IP(CHKARGS);
-static void post_vs(CHKARGS);
static void post_OP(CHKARGS);
static void post_TH(CHKARGS);
static void post_UC(CHKARGS);
static void post_UR(CHKARGS);
+static void post_in(CHKARGS);
+static void post_vs(CHKARGS);
static const v_check __man_valids[MAN_MAX - MAN_TH] = {
post_TH, /* TH */
@@ -82,7 +83,7 @@ static const v_check __man_valids[MAN_MA
post_UC, /* UC */
NULL, /* PD */
post_AT, /* AT */
- NULL, /* in */
+ post_in, /* in */
post_OP, /* OP */
NULL, /* EX */
NULL, /* EE */
@@ -432,6 +433,22 @@ post_AT(CHKARGS)
free(man->meta.os);
man->meta.os = mandoc_strdup(p);
+}
+
+static void
+post_in(CHKARGS)
+{
+ char *s;
+
+ if (n->parent->tok != MAN_TP ||
+ n->parent->type != ROFFT_HEAD ||
+ n->child == NULL ||
+ *n->child->string == '+' ||
+ *n->child->string == '-')
+ return;
+ mandoc_asprintf(&s, "+%s", n->child->string);
+ free(n->child->string);
+ n->child->string = s;
}
static void
--- /dev/null
+++ regress/man/TP/indent.in
@@ -0,0 +1,14 @@
+.TH TP-INDENT 1 "June 17, 2017" OpenBSD
+.SH NAME
+TP-indent \- indent request inside TP head
+.SH DESCRIPTION
+initial text
+.TP 2n
+tag
+indented
+.TP 8n
+.in 3n
+tag
+indented
+.PP
+final text
--- /dev/null
+++ regress/man/TP/indent.out_ascii
@@ -0,0 +1,20 @@
+TP-INDENT(1) General Commands Manual TP-INDENT(1)
+
+
+
+N\bNA\bAM\bME\bE
+ TP-indent - indent request inside TP head
+
+D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
+ initial text
+
+ tag
+ indented
+
+ tag indented
+
+ final text
+
+
+
+OpenBSD June 17, 2017 TP-INDENT(1)
Index: Makefile
===================================================================
RCS file: /home/cvs/mdocml/mdocml/regress/man/TP/Makefile,v
retrieving revision 1.2
retrieving revision 1.3
diff -Lregress/man/TP/Makefile -Lregress/man/TP/Makefile -u -p -r1.2 -r1.3
--- regress/man/TP/Makefile
+++ regress/man/TP/Makefile
@@ -1,6 +1,6 @@
# $OpenBSD: Makefile,v 1.12 2015/09/21 13:24:32 schwarze Exp $
-REGRESS_TARGETS = badarg broken double eof fill literal longhead
+REGRESS_TARGETS = badarg broken double eof fill indent literal longhead
REGRESS_TARGETS += macrotag manyargs sameline spacing width
LINT_TARGETS = broken double eof
--
To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-06-17 16:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-17 16:47 mdocml: if .in is used inside the .TP head, it's always relative schwarze
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).