aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-03-07 13:28:02 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-03-07 13:28:02 +0000
commit510b3c8287817db66b5cc52d4532763c113e341d (patch)
tree5f16f55d95981fc8029f035291b80e5de3413397
parent65a4977ab032daa686d1fb9c4b076d62a13329e8 (diff)
downloadmandoc-510b3c8287817db66b5cc52d4532763c113e341d.tar.gz
mandoc-510b3c8287817db66b5cc52d4532763c113e341d.tar.zst
mandoc-510b3c8287817db66b5cc52d4532763c113e341d.zip
fix spacing after empty .Fl
-rw-r--r--mdoc_markdown.c14
-rw-r--r--regress/mdoc/Fl/Makefile2
-rw-r--r--regress/mdoc/Fl/noarg.out_markdown2
3 files changed, 14 insertions, 4 deletions
diff --git a/mdoc_markdown.c b/mdoc_markdown.c
index 79d1f3dc..f6fb7fdf 100644
--- a/mdoc_markdown.c
+++ b/mdoc_markdown.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_markdown.c,v 1.5 2017/03/07 13:09:27 schwarze Exp $ */
+/* $Id: mdoc_markdown.c,v 1.6 2017/03/07 13:28:02 schwarze Exp $ */
/*
* Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org>
*
@@ -90,6 +90,7 @@ static void md_post_En(struct roff_node *);
static void md_post_Eo(struct roff_node *);
static void md_post_Fa(struct roff_node *);
static void md_post_Fd(struct roff_node *);
+static void md_post_Fl(struct roff_node *);
static void md_post_Fn(struct roff_node *);
static void md_post_Fo(struct roff_node *);
static void md_post_In(struct roff_node *);
@@ -126,7 +127,7 @@ static const struct md_act md_acts[MDOC_MAX + 1] = {
{ NULL, NULL, NULL, NULL, NULL }, /* Ex */
{ NULL, md_pre_Fa, md_post_Fa, NULL, NULL }, /* Fa */
{ NULL, md_pre_Fd, md_post_Fd, "**", "**" }, /* Fd */
- { NULL, md_pre_raw, md_post_raw, "**-", "**" }, /* Fl */
+ { NULL, md_pre_raw, md_post_Fl, "**-", "**" }, /* Fl */
{ 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 */
@@ -1018,6 +1019,15 @@ md_post_Fd(struct roff_node *n)
outflags |= MD_br;
}
+static void
+md_post_Fl(struct roff_node *n)
+{
+ md_post_raw(n);
+ if (n->child == NULL && n->next != NULL &&
+ n->next->type != ROFFT_TEXT && !(n->next->flags & NODE_LINE))
+ outflags &= ~MD_spc;
+}
+
static int
md_pre_Fn(struct roff_node *n)
{
diff --git a/regress/mdoc/Fl/Makefile b/regress/mdoc/Fl/Makefile
index b024856e..df24f7c0 100644
--- a/regress/mdoc/Fl/Makefile
+++ b/regress/mdoc/Fl/Makefile
@@ -1,6 +1,6 @@
# $OpenBSD: Makefile,v 1.8 2014/08/21 12:56:24 schwarze Exp $
REGRESS_TARGETS = noarg multiarg parsed punct font
-MARKDOWN_TARGETS = noarg multiarg punct font
+MARKDOWN_TARGETS = noarg multiarg parsed punct font
.include <bsd.regress.mk>
diff --git a/regress/mdoc/Fl/noarg.out_markdown b/regress/mdoc/Fl/noarg.out_markdown
index 9edc191d..7c023597 100644
--- a/regress/mdoc/Fl/noarg.out_markdown
+++ b/regress/mdoc/Fl/noarg.out_markdown
@@ -16,7 +16,7 @@ trailing punctuation
**-**.
Following macros
-**-** \[flag]
+**-**\[flag]
follow without white space.
OpenBSD - August 21, 2014