summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
8132b41)
was causing emphasis to be broken (particularly noticeable in text-like
backends). There are some instances of this in the PuTTY manual, for instance.
Unfortunately, \k references in similar situations still aren't quite right,
but fixing that will be more involved, and I haven't found any instances
yet.
git-svn-id: svn://svn.tartarus.org/sgt/halibut@7049
cda61777-01e9-0310-a592-
d414129be87e
quote_Close = 0x0020,
quote_mask = 0x0030
};
quote_Close = 0x0020,
quote_mask = 0x0030
};
+#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 isattr(x) ( ( (x) > word_Normal && (x) < word_WhiteSpace ) || \
( (x) > word_WhiteSpace && (x) < word_internal_endattrs ) )
#define sameattr(x,y) ( (((x)-(y)) & 3) == 0 )
An invisible index tag: \I{she seems to have an invisible tag}yeah.
An invisible index tag: \I{she seems to have an invisible tag}yeah.
+An index tag inside another tag: jackdaws love my \e{big \i{sphinx}}
+of quartz.
+
+Similarly, we should support things like hyperlinks
+\e{\W{http://www.tartarus.org/}{at the beginning} of emphasised sections},
+and \e{in the \W{http://www.tartarus.org/}{middle} of them}, and also
+\e{at the \W{http://home.att.net/~cecw/lastpage.htm}{end}}.
+
+\#{FIXME: Unfortunately, we still don't quite do the right thing with
+references:
+How about a \e{reference to \k{subhead} here}? And at
+\e{the end: \k{subhead}} and \e{\k{subhead}: the start}?
+}
+
\S2{sub-sub}{Florble} Smaller heading still
A tiny section. Awww. How cute. Actually, this one's a \e{florble},
\S2{sub-sub}{Florble} Smaller heading still
A tiny section. Awww. How cute. Actually, this one's a \e{florble},
wp = NULL;
for (w = words; w; w = w->next) {
wp = NULL;
for (w = words; w; w = w->next) {
- if (isattr(w->type)) {
- int before = (wp && isattr(wp->type) &&
- sameattr(wp->type, w->type));
- int after = (w->next && isattr(w->next->type) &&
- sameattr(w->next->type, w->type));
- w->aux |= (before ?
- (after ? attr_Always : attr_Last) :
- (after ? attr_First : attr_Only));
+ int both;
+ if (!isvis(w->type))
+ /* Invisible elements should not affect this calculation */
+ continue;
+ both = (isattr(w->type) &&
+ wp && isattr(wp->type) &&
+ sameattr(wp->type, w->type));
+ w->aux |= both ? attr_Always : attr_First;
+ if (wp && !both) {
+ /* If previous considered word turns out to have been
+ * the end of a run, tidy it up. */
+ int wp_attr = attraux(wp->aux);
+ wp->aux = (wp->aux & ~attr_mask) |
+ ((wp_attr == attr_Always) ? attr_Last
+ /* attr_First */ : attr_Only);
+
+ /* Tidy up last word touched */
+ if (wp) {
+ int wp_attr = attraux(wp->aux);
+ wp->aux = (wp->aux & ~attr_mask) |
+ ((wp_attr == attr_Always) ? attr_Last
+ /* attr_First */ : attr_Only);
+ }