summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mdoc_markdown.c15
-rw-r--r--regress/mdoc/Fd/Makefile2
-rw-r--r--regress/mdoc/Fd/empty.out_markdown17
-rw-r--r--regress/mdoc/In/Makefile2
-rw-r--r--regress/mdoc/In/break.out_markdown35
-rw-r--r--regress/mdoc/In/noarg.out_markdown25
6 files changed, 85 insertions, 11 deletions
diff --git a/mdoc_markdown.c b/mdoc_markdown.c
index 1e1f115d..04710d0e 100644
--- a/mdoc_markdown.c
+++ b/mdoc_markdown.c
@@ -129,7 +129,7 @@ static const struct md_act md_acts[MDOC_MAX + 1] = {
{ NULL, md_pre_Fn, md_post_Fn, NULL, NULL }, /* Fn */
{ NULL, md_pre_Fd, md_post_raw, "*", "*" }, /* Ft */
{ NULL, md_pre_raw, md_post_raw, "**", "**" }, /* Ic */
- { NULL, md_pre_In, md_post_In, "*", "*" }, /* In */
+ { NULL, md_pre_In, md_post_In, NULL, NULL }, /* In */
{ NULL, md_pre_raw, md_post_raw, "`", "`" }, /* Li */
{ md_cond_head, md_pre_Nd, NULL, NULL, NULL }, /* Nd */
{ NULL, md_pre_Nm, md_post_Nm, "**", "**" }, /* Nm */
@@ -1067,16 +1067,15 @@ md_pre_In(struct roff_node *n)
{
if (n->flags & NODE_SYNPRETTY) {
md_pre_syn(n);
- md_pre_raw(n);
- md_rawword("*");
+ md_rawword("**");
outflags &= ~MD_spc;
md_word("#include <");
- outflags &= ~MD_spc;
} else {
md_word("<");
outflags &= ~MD_spc;
- md_pre_raw(n);
+ md_rawword("*");
}
+ outflags &= ~MD_spc;
return 1;
}
@@ -1085,13 +1084,11 @@ md_post_In(struct roff_node *n)
{
if (n->flags & NODE_SYNPRETTY) {
outflags &= ~MD_spc;
- md_rawword(">*");
- md_post_raw(n);
+ md_rawword(">**");
outflags |= MD_nl;
} else {
- md_post_raw(n);
outflags &= ~MD_spc;
- md_rawword(">");
+ md_rawword("*>");
}
}
diff --git a/regress/mdoc/Fd/Makefile b/regress/mdoc/Fd/Makefile
index c1c6d5dd..9c120609 100644
--- a/regress/mdoc/Fd/Makefile
+++ b/regress/mdoc/Fd/Makefile
@@ -3,6 +3,6 @@
REGRESS_TARGETS = break empty eos font
LINT_TARGETS = empty
SKIP_TMAN = eos
-MARKDOWN_TARGETS = break eos font
+MARKDOWN_TARGETS = break empty eos font
.include <bsd.regress.mk>
diff --git a/regress/mdoc/Fd/empty.out_markdown b/regress/mdoc/Fd/empty.out_markdown
new file mode 100644
index 00000000..9dc71039
--- /dev/null
+++ b/regress/mdoc/Fd/empty.out_markdown
@@ -0,0 +1,17 @@
+FD-EMPTY(1) - General Commands Manual
+
+# NAME
+
+**Fd-empty** - empty preprocessor directive macros
+
+# SYNOPSIS
+
+**#include &lt;sys/types.h>**
+**#include &lt;stdlib.h>**
+
+# DESCRIPTION
+
+leading text
+trailing text
+
+OpenBSD - February 5, 2015
diff --git a/regress/mdoc/In/Makefile b/regress/mdoc/In/Makefile
index 1c8a484f..9c92ccf4 100644
--- a/regress/mdoc/In/Makefile
+++ b/regress/mdoc/In/Makefile
@@ -2,6 +2,6 @@
REGRESS_TARGETS = break eos font noarg
LINT_TARGETS = noarg
-MARKDOWN_TARGETS = eos font
+MARKDOWN_TARGETS = break eos font noarg
.include <bsd.regress.mk>
diff --git a/regress/mdoc/In/break.out_markdown b/regress/mdoc/In/break.out_markdown
new file mode 100644
index 00000000..dbc1085f
--- /dev/null
+++ b/regress/mdoc/In/break.out_markdown
@@ -0,0 +1,35 @@
+IN-BREAK(2) - System Calls Manual
+
+# NAME
+
+**In-break** - line break before header include file
+
+# SYNOPSIS
+
+**#include &lt;fcntl.h>**
+
+*int*
+**open**(*const char \*path*, *int flags*, *mode\_t mode*);
+
+**#include &lt;sys/types.h>**
+**#include &lt;unistd.h>**
+
+*int*
+**dup**(*int oldd*);
+
+*ssize\_t*
+**write**(*int d*, *const void \*buf*, *size\_t nbytes*);
+
+# DESCRIPTION
+
+&lt;*fcntl.h*>
+*int*
+**open**(*const char \*path*, *int flags*, *mode\_t mode*)
+&lt;*sys/types.h*>
+&lt;*unistd.h*>
+*int*
+**dup**(*int oldd*)
+*ssize\_t*
+**write**(*int d*, *const void \*buf*, *size\_t nbytes*)
+
+OpenBSD - June 6, 2010
diff --git a/regress/mdoc/In/noarg.out_markdown b/regress/mdoc/In/noarg.out_markdown
new file mode 100644
index 00000000..81970226
--- /dev/null
+++ b/regress/mdoc/In/noarg.out_markdown
@@ -0,0 +1,25 @@
+IN-NOARG(2) - System Calls Manual
+
+# NAME
+
+**In-noarg** - include file macros without argument
+
+# SYNOPSIS
+
+**#include &lt;math.h>**
+
+*double*
+**sin**(*double x*);
+
+*double*
+**cos**(*double x*);
+
+# DESCRIPTION
+
+&lt;*math.h*>
+*double*
+**sin**(*double x*)
+*double*
+**cos**(*double x*)
+
+OpenBSD - February 5, 2015