diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-03-26 16:44:22 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-03-26 16:44:22 +0000 |
commit | b3a09b4f2e6de787535cd7659fd19f1c7f91eada (patch) | |
tree | f74d9a013373f43a1429659364ba769c792889c1 /terminal.c | |
parent | bd329dd8fae21fc03372e563b33ef77a421e7ea9 (diff) | |
download | mandoc-b3a09b4f2e6de787535cd7659fd19f1c7f91eada.tar.gz mandoc-b3a09b4f2e6de787535cd7659fd19f1c7f91eada.tar.zst mandoc-b3a09b4f2e6de787535cd7659fd19f1c7f91eada.zip |
Added simple font-escapes.
Diffstat (limited to 'terminal.c')
-rw-r--r-- | terminal.c | 22 |
1 files changed, 21 insertions, 1 deletions
@@ -1,4 +1,4 @@ -/* $Id: terminal.c,v 1.10 2009/03/26 14:44:41 kristaps Exp $ */ +/* $Id: terminal.c,v 1.11 2009/03/26 16:44:22 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@openbsd.org> * @@ -454,6 +454,26 @@ term_pescape(struct termp *p, const char *word, int *i, int len) term_nescape(p, &word[*i], 1); return; } + + } else if ('f' == word[*i]) { + if (++(*i) >= len) + return; + switch (word[*i]) { + case ('B'): + p->flags |= TERMP_BOLD; + break; + case ('I'): + p->flags |= TERMP_UNDER; + break; + case ('P'): + /* FALLTHROUGH */ + case ('R'): + p->flags &= ~TERMP_STYLE; + break; + default: + break; + } + return; } else if ('[' != word[*i]) { term_nescape(p, &word[*i], 1); |