From dcf080aa0e011de37a154e9e8a97dd7546a4a1b1 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sun, 10 Mar 2013 16:58:01 +0000 Subject: Add \s for 'strong' text, i.e. bold rather than italics. I've missed this a couple of times in Halibut markup recently (in particular, it's handy to have a typographical distinction between 'this term is emphasised because it's new' and 'this term is emphasised because I want you to pay attention to it'), so here's an implementation, basically parallel to \e. One slight oddity is that strong text in headings will not be distinguished in some output formats, since they already use bolded text for their headings. [originally from svn r9772] --- misc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'misc.c') diff --git a/misc.c b/misc.c index 3f2483c..8a426f2 100644 --- a/misc.c +++ b/misc.c @@ -113,7 +113,7 @@ static int compare_wordlists_literally(word *a, word *b) { return (a->type < b->type ? -1 : +1); /* FIXME? */ t = a->type; if ((t != word_Normal && t != word_Code && - t != word_WeakCode && t != word_Emph) || + t != word_WeakCode && t != word_Emph && t != word_Strong) || a->alt || b->alt) { int c; if (a->text && b->text) { @@ -326,12 +326,14 @@ wrappedline *wrap_para(word *text, int width, int subsequentwidth, wrapwords[nwords].end = text->next; if (text->next && (text->next->type == word_WhiteSpace || text->next->type == word_EmphSpace || + text->next->type == word_StrongSpace || text->breaks)) break; text = text->next; } if (text && text->next && (text->next->type == word_WhiteSpace || - text->next->type == word_EmphSpace)) { + text->next->type == word_EmphSpace || + text->next->type == word_StrongSpace)) { wrapwords[nwords].spacewidth = widthfn(ctx, text->next); text = text->next; } else { -- cgit v1.1