From 45f655402ed9aece7ea3dfffb8007a8c753d6f4a Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sun, 30 Jan 2011 16:05:37 +0000 Subject: Implement the \N'number' (numbered character) roff escape sequence. Don't use it in new manuals, it is inherently non-portable, but we need it for backward-compatibility with existing manuals, for example in Xenocara driver pages. ok kristaps@ jmc@ and tested by Matthieu Herrb (matthieu at openbsd dot org) --- term.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'term.c') diff --git a/term.c b/term.c index 5d18a69d..0ffdedd7 100644 --- a/term.c +++ b/term.c @@ -1,7 +1,7 @@ /* $Id$ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons - * Copyright (c) 2010 Ingo Schwarze + * Copyright (c) 2010, 2011 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 @@ -352,6 +352,17 @@ term_vspace(struct termp *p) } +static void +numbered(struct termp *p, const char *word, size_t len) +{ + const char *rhs; + + rhs = chars_num2char(word, len); + if (rhs) + encode(p, rhs, 1); +} + + static void spec(struct termp *p, enum roffdeco d, const char *word, size_t len) { @@ -511,6 +522,9 @@ term_word(struct termp *p, const char *word) word += a2roffdeco(&deco, &seq, &ssz); switch (deco) { + case (DECO_NUMBERED): + numbered(p, seq, ssz); + break; case (DECO_RESERVED): res(p, seq, ssz); break; -- cgit