From a5cf99ba0ce655c79f97727aa85c3afd804f98c9 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Wed, 22 Jan 2014 20:58:39 +0000 Subject: 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 . --- html.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'html.c') diff --git a/html.c b/html.c index 30ed53e4..bbc9ec5b 100644 --- a/html.c +++ b/html.c @@ -1,7 +1,7 @@ -/* $Id: html.c,v 1.153 2014/01/05 19:10:56 joerg Exp $ */ +/* $Id: html.c,v 1.154 2014/01/22 20:58:39 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons - * Copyright (c) 2011, 2012, 2013 Ingo Schwarze + * Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze * * 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("&"); continue; + case (ASCII_NBRSP): + putchar('-'); + continue; case (ASCII_HYPH): putchar('-'); + /* FALLTHROUGH */ + case (ASCII_BREAK): continue; default: break; -- cgit v1.2.3-56-ge451