X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/halibut/blobdiff_plain/d7482997dd1ca71b70df43c15dd5956f435a1a7e..c5785c5369caeb24567503aeee2a0a19c7b67640:/index.c?ds=sidebyside diff --git a/index.c b/index.c index 3b1df51..c312f07 100644 --- a/index.c +++ b/index.c @@ -61,6 +61,24 @@ void index_merge(indexdata *idx, int is_explicit, wchar_t *tags, word *text) { indextag *t, *existing; /* + * For an implicit merge, we want to remove all emphasis, + * because the chances are that the user didn't really want to + * index the term as emphasised. + */ + { + word *w; + + for (w = text; w; w = w->next) { + if (w->type == word_Emph) + w->type = word_Normal; + else if (w->type == word_EmphSpace) + w->type = word_WhiteSpace; + else if (w->type == word_EmphQuote) + w->type = word_Quote; + } + } + + /* * FIXME: want to warn on overlapping source sets. */ for (; *tags; tags = uadv(tags)) {