summaryrefslogtreecommitdiffstats
path: root/html.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-01-22 20:58:39 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-01-22 20:58:39 +0000
commit654e28baaa103a868af40d8ce155ddd09fe76f98 (patch)
tree061e60883aded25bdcf06071df7bf3b4e00c8548 /html.c
parent3d40007c4e92346d3e69337fa770e26de69c6ffe (diff)
downloadmandoc-654e28baaa103a868af40d8ce155ddd09fe76f98.tar.gz
Implement the \: (optional line break) escape sequence,
documented in the Ossanna-Kernighan-Ritter troff manual and also supported by groff. Missing feature reported by Steffen Nurpmeso <sdaoden at gmail dot com>.
Diffstat (limited to 'html.c')
-rw-r--r--html.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/html.c b/html.c
index b61e60ac..17976fd4 100644
--- a/html.c
+++ b/html.c
@@ -1,7 +1,7 @@
/* $Id$ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2011, 2012, 2013 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -331,7 +331,8 @@ print_encode(struct html *h, const char *p, int norecurse)
int c, len, nospace;
const char *seq;
enum mandoc_esc esc;
- static const char rejs[6] = { '\\', '<', '>', '&', ASCII_HYPH, '\0' };
+ static const char rejs[8] = { '\\', '<', '>', '&',
+ ASCII_NBRSP, ASCII_HYPH, ASCII_BREAK, '\0' };
nospace = 0;
@@ -360,8 +361,13 @@ print_encode(struct html *h, const char *p, int norecurse)
case ('&'):
printf("&amp;");
continue;
+ case (ASCII_NBRSP):
+ putchar('-');
+ continue;
case (ASCII_HYPH):
putchar('-');
+ /* FALLTHROUGH */
+ case (ASCII_BREAK):
continue;
default:
break;