From 425023e05c1bd81978a4a2cb3189bdce8dcc0e95 Mon Sep 17 00:00:00 2001 From: Norman Rasmussen Date: Thu, 8 Dec 2005 18:28:35 +0000 Subject: [PATCH] Closes #1231 --- src/conversation_textview.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/conversation_textview.py b/src/conversation_textview.py index d82020fc4..788ce9f71 100644 --- a/src/conversation_textview.py +++ b/src/conversation_textview.py @@ -464,11 +464,11 @@ class ConversationTextview(gtk.TextView): use_other_tags = False elif special_text.startswith('*'): # it's a bold text tags.append('bold') - if special_text[1] == '/': # it's also italic + if special_text[1] == '/' and special_text[-2] == '/' and len(special_text) > 4: # it's also italic tags.append('italic') if not show_ascii_formatting_chars: special_text = special_text[2:-2] # remove */ /* - elif special_text[1] == '_': # it's also underlined + elif special_text[1] == '_' and special_text[-2] == '_' and len(special_text) > 4: # it's also underlined tags.append('underline') if not show_ascii_formatting_chars: special_text = special_text[2:-2] # remove *_ _* @@ -477,11 +477,11 @@ class ConversationTextview(gtk.TextView): special_text = special_text[1:-1] # remove * * elif special_text.startswith('/'): # it's an italic text tags.append('italic') - if special_text[1] == '*': # it's also bold + if special_text[1] == '*' and special_text[-2] == '*' and len(special_text) > 4: # it's also bold tags.append('bold') if not show_ascii_formatting_chars: special_text = special_text[2:-2] # remove /* */ - elif special_text[1] == '_': # it's also underlined + elif special_text[1] == '_' and special_text[-2] == '_' and len(special_text) > 4: # it's also underlined tags.append('underline') if not show_ascii_formatting_chars: special_text = special_text[2:-2] # remove /_ _/ @@ -490,11 +490,11 @@ class ConversationTextview(gtk.TextView): special_text = special_text[1:-1] # remove / / elif special_text.startswith('_'): # it's an underlined text tags.append('underline') - if special_text[1] == '*': # it's also bold + if special_text[1] == '*' and special_text[-2] == '*' and len(special_text) > 4: # it's also bold tags.append('bold') if not show_ascii_formatting_chars: special_text = special_text[2:-2] # remove _* *_ - elif special_text[1] == '/': # it's also italic + elif special_text[1] == '/' and special_text[-2] == '/' and len(special_text) > 4: # it's also italic tags.append('italic') if not show_ascii_formatting_chars: special_text = special_text[2:-2] # remove _/ /_