]> git.cameronkatri.com Git - mandoc.git/blobdiff - mdoc_markdown.c
If messages are shown and output is printed without a pager, display
[mandoc.git] / mdoc_markdown.c
index fcc636388b7b7bd101a4c56493339e57d7ead799..88e37c0b188bd1dc38f9db7c9e5a8575b4547103 100644 (file)
@@ -1,4 +1,4 @@
-/*     $Id: mdoc_markdown.c,v 1.28 2018/12/03 21:00:10 schwarze Exp $ */
+/*     $Id: mdoc_markdown.c,v 1.31 2019/07/01 22:56:24 schwarze Exp $ */
 /*
  * Copyright (c) 2017, 2018 Ingo Schwarze <schwarze@openbsd.org>
  *
@@ -261,21 +261,21 @@ md_act(enum roff_tok tok)
 }
 
 void
-markdown_mdoc(void *arg, const struct roff_man *mdoc)
+markdown_mdoc(void *arg, const struct roff_meta *mdoc)
 {
        outflags = MD_Sm;
-       md_word(mdoc->meta.title);
-       if (mdoc->meta.msec != NULL) {
+       md_word(mdoc->title);
+       if (mdoc->msec != NULL) {
                outflags &= ~MD_spc;
                md_word("(");
-               md_word(mdoc->meta.msec);
+               md_word(mdoc->msec);
                md_word(")");
        }
        md_word("-");
-       md_word(mdoc->meta.vol);
-       if (mdoc->meta.arch != NULL) {
+       md_word(mdoc->vol);
+       if (mdoc->arch != NULL) {
                md_word("(");
-               md_word(mdoc->meta.arch);
+               md_word(mdoc->arch);
                md_word(")");
        }
        outflags |= MD_sp;
@@ -283,9 +283,9 @@ markdown_mdoc(void *arg, const struct roff_man *mdoc)
        md_nodelist(mdoc->first->child);
 
        outflags |= MD_sp;
-       md_word(mdoc->meta.os);
+       md_word(mdoc->os);
        md_word("-");
-       md_word(mdoc->meta.date);
+       md_word(mdoc->date);
        putchar('\n');
 }
 
@@ -589,6 +589,9 @@ md_word(const char *s)
                        case ESCAPE_SPECIAL:
                                uc = mchars_spec2cp(seq, sz);
                                break;
+                       case ESCAPE_UNDEF:
+                               uc = *seq;
+                               break;
                        case ESCAPE_DEVICE:
                                md_rawword("markdown");
                                continue;
@@ -1287,7 +1290,7 @@ md_post_It(struct roff_node *n)
                while ((n = n->prev) != NULL && n->type != ROFFT_HEAD)
                        i++;
 
-               /* 
+               /*
                 * If a width was specified for this column,
                 * subtract what printed, and
                 * add the same spacing as in mdoc_term.c.