1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

fix rules for italics emphasis

while the last patch did stop /path/.xxx from turning italic, it also
stopped any other /emphasis/ from becoming italic. correct this by
testing for ispunct, so spaces are valid italic terminators
This commit is contained in:
Ailin Nemui 2014-07-24 09:42:57 +02:00
parent e7f83c1dd2
commit 07e37c2329

View File

@ -82,7 +82,9 @@ char *expand_emphasis(WI_ITEM_REC *item, const char *text)
continue; continue;
if (!ishighalnum(end[-1]) || ishighalnum(end[1]) || if (!ishighalnum(end[-1]) || ishighalnum(end[1]) ||
end[1] == type || end[1] == '*' || end[1] == '_' || end[1] == type || end[1] == '*' || end[1] == '_' ||
(type == 29 && end[1] != '\0' && ishighalnum(end[2]))) /* special case for italics to not emphasise
common paths by skipping /.../.X */
(type == 29 && i_ispunct(end[1]) && ishighalnum(end[2])))
continue; continue;
if (IS_CHANNEL(item)) { if (IS_CHANNEL(item)) {