]> git.cameronkatri.com Git - mandoc.git/blobdiff - mdocterm.c
Many more changes and fixes (`In', `Fd', etc.).
[mandoc.git] / mdocterm.c
index 3e2f70f05dbc74549f01920e6606adb86a7161f9..02c80e6c1dc17df05b4bf52624bbdc76276e59d1 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: mdocterm.c,v 1.18 2009/02/27 10:55:16 kristaps Exp $ */
+/* $Id: mdocterm.c,v 1.21 2009/02/28 21:31:13 kristaps Exp $ */
 /*
  * Copyright (c) 2008 Kristaps Dzonsons <kristaps@kth.se>
  *
@@ -112,7 +112,7 @@ main(int argc, char *argv[])
        if (NULL == (mdoc = mmain_mdoc(p)))
                mmain_exit(p, 1);
 
-       termp.maxrmargin = 80; /* XXX */
+       termp.maxrmargin = 78; /* XXX */
        termp.rmargin = termp.maxrmargin;
        termp.maxcols = 1024;
        termp.offset = termp.col = 0;
@@ -465,6 +465,10 @@ pescape(struct termp *p, const char *word, size_t *i, size_t len)
                        /* FALLTHROUGH */
                case ('.'):
                        chara(p, word[*i]);
+                       break;
+               case ('e'):
+                       chara(p, '\\');
+                       break;
                default:
                        break;
                }
@@ -554,7 +558,14 @@ word(struct termp *p, const char *word)
                if ( ! xisspace(word[i])) {
                        j++;
                        continue;
+               } 
+               
+               /* Escaped spaces don't delimit... */
+               if (i > 0 && xisspace(word[i]) && '\\' == word[i - 1]) {
+                       j++;
+                       continue;
                }
+
                if (0 == j)
                        continue;
                assert(i >= j);