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 _/ /_