-.\" $OpenBSD: blank.in,v 1.6 2017/07/04 14:53:24 schwarze Exp $
-.Dd $Mdocdate: July 4 2017 $
+.\" $OpenBSD: blank.in,v 1.7 2022/08/15 17:59:00 schwarze Exp $
+.Dd $Mdocdate: August 15 2022 $
.Dt BD-BLANK 1
.Os
.Sh NAME
line containing space tab space:
+line containing a zero-width space:
+\&
+line containing an invalid numbered character escape:
+\N'257'
+line containing an invalid named character escape:
+\[foobar]
+line containing a font escape:
+\fR
line starting with a blank character:
x
line starting with two blank characters:
line containing space tab space:
+ line containing a zero-width space:
+
+ line containing an invalid numbered character escape:
+
+ line containing an invalid named character escape:
+
+ line containing a font escape:
line starting with a blank character:
x
line starting with two blank characters:
mandoc: blank.in:13:1: STYLE: whitespace at end of input line
mandoc: blank.in:15:1: STYLE: whitespace at end of input line
mandoc: blank.in:17:1: STYLE: whitespace at end of input line
-mandoc: blank.in:22:36: STYLE: whitespace at end of input line
-mandoc: blank.in:23:37: STYLE: whitespace at end of input line
-mandoc: blank.in:24:32: STYLE: whitespace at end of input line
-mandoc: blank.in:31:8: STYLE: whitespace at end of input line
-mandoc: blank.in:31:2: WARNING: empty block: Dl
+mandoc: blank.in:23:1: ERROR: unknown special character: \[foobar]
+mandoc: blank.in:30:36: STYLE: whitespace at end of input line
+mandoc: blank.in:31:37: STYLE: whitespace at end of input line
+mandoc: blank.in:32:32: STYLE: whitespace at end of input line
+mandoc: blank.in:39:8: STYLE: whitespace at end of input line
+mandoc: blank.in:39:2: WARNING: empty block: Dl
line containing space tab space:
+ line containing a zero-width space:
+
+ line containing an invalid numbered character escape:
+ <?>
+ line containing an invalid named character escape:
+ <?>
+ line containing a font escape:
+
line starting with a blank character:
x
line starting with two blank characters:
-/* $OpenBSD: mandoc.h,v 1.221 2022/06/07 09:51:03 schwarze Exp $ */
+/* $OpenBSD: mandoc.h,v 1.222 2022/08/15 17:59:00 schwarze Exp $ */
/*
* Copyright (c) 2012-2022 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2010, 2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
*/
#define ASCII_NBRSP 31 /* non-breaking space */
-#define ASCII_HYPH 30 /* breakable hyphen */
-#define ASCII_BREAK 29 /* breakable zero-width space */
+#define ASCII_NBRZW 30 /* non-breaking zero-width space */
+#define ASCII_BREAK 29 /* breakable zero-width space */
+#define ASCII_HYPH 28 /* breakable hyphen */
/*
* Status level. This refers to both internal status (i.e., whilst
-/* $OpenBSD: term.c,v 1.148 2022/08/15 13:01:40 schwarze Exp $ */
+/* $OpenBSD: term.c,v 1.149 2022/08/15 17:59:00 schwarze Exp $ */
/*
* Copyright (c) 2010-2022 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
return;
endline(p);
- p->viscol = 0;
/*
* Normally, start the next line at the same indentation
vis = term_tab_next(vis);
vis -= p->tcol->taboff;
break;
+ case ASCII_NBRZW: /* Non-breakable zero-width. */
+ break;
case ASCII_NBRSP: /* Non-breakable space. */
p->tcol->buf[ic] = ' ';
/* FALLTHROUGH */
switch (p->tcol->buf[ic]) {
case '\n':
case ASCII_BREAK:
+ case ASCII_NBRZW:
continue;
case '\t':
case ' ':
break;
case ESCAPE_NUMBERED:
uc = mchars_num2char(seq, sz);
- if (uc < 0)
- continue;
- break;
+ if (uc >= 0)
+ break;
+ bufferc(p, ASCII_NBRZW);
+ continue;
case ESCAPE_SPECIAL:
if (p->enc == TERMENC_ASCII) {
cp = mchars_spec2str(seq, sz, &ssz);
if (cp != NULL)
encode(p, cp, ssz);
+ else
+ bufferc(p, ASCII_NBRZW);
} else {
uc = mchars_spec2cp(seq, sz);
if (uc > 0)
encode1(p, uc);
+ else
+ bufferc(p, ASCII_NBRZW);
}
continue;
case ESCAPE_UNDEF:
if (p->col > p->tcol->lastcol)
p->col = p->tcol->lastcol;
continue;
+ case ESCAPE_IGNORE:
+ bufferc(p, ASCII_NBRZW);
+ continue;
default:
continue;
}
int ssz, skip, uc;
const char *seq, *rhs;
enum mandoc_esc esc;
- static const char rej[] = { '\\', ASCII_NBRSP, ASCII_HYPH,
- ASCII_BREAK, '\0' };
+ static const char rej[] = { '\\', ASCII_NBRSP, ASCII_NBRZW,
+ ASCII_BREAK, ASCII_HYPH, '\0' };
/*
* Account for escaped sequences within string length
-/* $OpenBSD: term_ascii.c,v 1.52 2020/09/09 13:40:24 schwarze Exp $ */
+/* $OpenBSD: term_ascii.c,v 1.53 2022/08/15 17:59:00 schwarze Exp $ */
/*
* Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014,2015,2017,2018,2020 Ingo Schwarze <schwarze@openbsd.org>
static size_t
ascii_width(const struct termp *p, int c)
{
- return c != ASCII_BREAK;
+ return c != ASCII_BREAK && c != ASCII_NBRZW;
}
void