summaryrefslogtreecommitdiff
path: root/bk_html.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2013-03-10 16:58:01 +0000
committerSimon Tatham <anakin@pobox.com>2013-03-10 16:58:01 +0000
commitdcf080aa0e011de37a154e9e8a97dd7546a4a1b1 (patch)
tree891d703334a6d4f4899f058234c52d56cb7bdb3b /bk_html.c
parent1489dc15967970576d08f3f2b22c6e1c939bcbcf (diff)
downloadhalibut-dcf080aa0e011de37a154e9e8a97dd7546a4a1b1.zip
halibut-dcf080aa0e011de37a154e9e8a97dd7546a4a1b1.tar.gz
halibut-dcf080aa0e011de37a154e9e8a97dd7546a4a1b1.tar.bz2
halibut-dcf080aa0e011de37a154e9e8a97dd7546a4a1b1.tar.xz
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]
Diffstat (limited to 'bk_html.c')
-rw-r--r--bk_html.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/bk_html.c b/bk_html.c
index 3a49bdc..0c624e4 100644
--- a/bk_html.c
+++ b/bk_html.c
@@ -2231,14 +2231,17 @@ static void html_words(htmloutput *ho, word *words, int flags,
break;
case word_Normal:
case word_Emph:
+ case word_Strong:
case word_Code:
case word_WeakCode:
case word_WhiteSpace:
case word_EmphSpace:
+ case word_StrongSpace:
case word_CodeSpace:
case word_WkCodeSpace:
case word_Quote:
case word_EmphQuote:
+ case word_StrongQuote:
case word_CodeQuote:
case word_WkCodeQuote:
style = towordstyle(w->type);
@@ -2248,6 +2251,11 @@ static void html_words(htmloutput *ho, word *words, int flags,
attraux(w->aux) == attr_Only) &&
(flags & MARKUP))
element_open(ho, "em");
+ else if (style == word_Strong &&
+ (attraux(w->aux) == attr_First ||
+ attraux(w->aux) == attr_Only) &&
+ (flags & MARKUP))
+ element_open(ho, "strong");
else if ((style == word_Code || style == word_WeakCode) &&
(attraux(w->aux) == attr_First ||
attraux(w->aux) == attr_Only) &&
@@ -2273,6 +2281,11 @@ static void html_words(htmloutput *ho, word *words, int flags,
attraux(w->aux) == attr_Only) &&
(flags & MARKUP))
element_close(ho, "em");
+ else if (style == word_Strong &&
+ (attraux(w->aux) == attr_Last ||
+ attraux(w->aux) == attr_Only) &&
+ (flags & MARKUP))
+ element_close(ho, "strong");
else if ((style == word_Code || style == word_WeakCode) &&
(attraux(w->aux) == attr_Last ||
attraux(w->aux) == attr_Only) &&