=================================================================== RCS file: /cvs/pod2mdoc/pod2mdoc.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -p -r1.6 -r1.7 --- pod2mdoc/pod2mdoc.c 2014/03/23 23:23:38 1.6 +++ pod2mdoc/pod2mdoc.c 2014/03/23 23:35:59 1.7 @@ -1,4 +1,4 @@ -/* $Id: pod2mdoc.c,v 1.6 2014/03/23 23:23:38 kristaps Exp $ */ +/* $Id: pod2mdoc.c,v 1.7 2014/03/23 23:35:59 kristaps Exp $ */ /* * Copyright (c) 2014 Kristaps Dzonsons * @@ -624,12 +624,19 @@ command(struct state *st, const char *buf, size_t star static void verbatim(struct state *st, const char *buf, size_t start, size_t end) { + size_t sv = start; if ( ! st->parsing || st->paused) return; puts(".Bd -literal"); - printf("%.*s\n", (int)(end - start), &buf[start]); + while (start < end) { + if (start > sv && '\n' == buf[start - 1]) + if ('.' == buf[start] || '\'' == buf[start]) + printf("\\&"); + putchar(buf[start++]); + } + putchar('\n'); puts(".Ed"); }