diff options
| author | Simon Tatham <anakin@pobox.com> | 2013-03-10 16:58:01 +0000 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2013-03-10 16:58:01 +0000 |
| commit | dcf080aa0e011de37a154e9e8a97dd7546a4a1b1 (patch) | |
| tree | 891d703334a6d4f4899f058234c52d56cb7bdb3b /halibut.h | |
| parent | 1489dc15967970576d08f3f2b22c6e1c939bcbcf (diff) | |
| download | halibut-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 'halibut.h')
| -rw-r--r-- | halibut.h | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -146,16 +146,19 @@ enum { /* ORDERING CONSTRAINT: these normal-word types ... */ word_Normal, word_Emph, + word_Strong, word_Code, /* monospaced; `quoted' in text */ word_WeakCode, /* monospaced, normal in text */ /* ... must be in the same order as these space types ... */ word_WhiteSpace, /* text is NULL or ignorable */ word_EmphSpace, /* WhiteSpace when emphasised */ + word_StrongSpace, /* WhiteSpace when strong */ word_CodeSpace, /* WhiteSpace when code */ word_WkCodeSpace, /* WhiteSpace when weak code */ /* ... and must be in the same order as these quote types ... */ word_Quote, /* text is NULL or ignorable */ word_EmphQuote, /* Quote when emphasised */ + word_StrongQuote, /* Quote when strong */ word_CodeQuote, /* (can't happen) */ word_WkCodeQuote, /* (can't happen) */ /* END ORDERING CONSTRAINT */ @@ -189,11 +192,12 @@ enum { #define isvis(x) ( ( (x) >= word_Normal && (x) <= word_LowerXref ) ) #define isattr(x) ( ( (x) > word_Normal && (x) < word_WhiteSpace ) || \ ( (x) > word_WhiteSpace && (x) < word_internal_endattrs ) ) -#define sameattr(x,y) ( (((x)-(y)) & 3) == 0 ) -#define towordstyle(x) ( word_Normal + ((x) & 3) ) -#define tospacestyle(x) ( word_WhiteSpace + ((x) & 3) ) -#define toquotestyle(x) ( word_Quote + ((x) & 3) ) -#define removeattr(x) ( word_Normal + ((x) &~ 3) ) +#define NATTRS (word_WhiteSpace - word_Normal) +#define sameattr(x,y) ( (((x)-(y)) % NATTRS) == 0 ) +#define towordstyle(x) ( word_Normal + ((x) % NATTRS) ) +#define tospacestyle(x) ( word_WhiteSpace + ((x) % NATTRS) ) +#define toquotestyle(x) ( word_Quote + ((x) % NATTRS) ) +#define removeattr(x) ( word_Normal + ((x)/NATTRS * NATTRS) ) #define attraux(x) ( (x) & attr_mask ) #define quoteaux(x) ( (x) & quote_mask ) |