Philipp Hörist pushed to branch master at gajim / gajim

Commits:

2 changed files:

Changes:

  • gajim/conversation_textview.py
    ... ... @@ -194,8 +194,8 @@ def __init__(self, account, used_in_history_window=False):
    194 194
             tag = buffer_.create_tag('italic')
    
    195 195
             tag.set_property('style', Pango.Style.ITALIC)
    
    196 196
     
    
    197
    -        tag = buffer_.create_tag('underline')
    
    198
    -        tag.set_property('underline', Pango.Underline.SINGLE)
    
    197
    +        tag = buffer_.create_tag('strikethrough')
    
    198
    +        tag.set_property('strikethrough', True)
    
    199 199
     
    
    200 200
             buffer_.create_tag('focus-out-line', justification=Gtk.Justification.CENTER)
    
    201 201
             self.displaymarking_tags = {}
    
    ... ... @@ -692,46 +692,46 @@ def print_special_text(self, special_text, other_tags, graphics=True,
    692 692
                 tags.append('sth_at_sth')
    
    693 693
             elif special_text.startswith('*'): # it's a bold text
    
    694 694
                 tags.append('bold')
    
    695
    -            if special_text[1] == '/' and special_text[-2] == '/' and\
    
    696
    -            len(special_text) > 4: # it's also italic
    
    697
    -                tags.append('italic')
    
    695
    +            if special_text[1] == '~' and special_text[-2] == '~' and\
    
    696
    +            len(special_text) > 4: # it's also strikethrough
    
    697
    +                tags.append('strikethrough')
    
    698 698
                     if not show_ascii_formatting_chars:
    
    699
    -                    special_text = special_text[2:-2] # remove */ /*
    
    699
    +                    special_text = special_text[2:-2] # remove *~ ~*
    
    700 700
                 elif special_text[1] == '_' and special_text[-2] == '_' and \
    
    701
    -            len(special_text) > 4: # it's also underlined
    
    702
    -                tags.append('underline')
    
    701
    +            len(special_text) > 4: # it's also italic
    
    702
    +                tags.append('italic')
    
    703 703
                     if not show_ascii_formatting_chars:
    
    704 704
                         special_text = special_text[2:-2] # remove *_ _*
    
    705 705
                 else:
    
    706 706
                     if not show_ascii_formatting_chars:
    
    707 707
                         special_text = special_text[1:-1] # remove * *
    
    708
    -        elif special_text.startswith('/'): # it's an italic text
    
    709
    -            tags.append('italic')
    
    708
    +        elif special_text.startswith('~'): # it's a strikethrough text
    
    709
    +            tags.append('strikethrough')
    
    710 710
                 if special_text[1] == '*' and special_text[-2] == '*' and \
    
    711 711
                 len(special_text) > 4: # it's also bold
    
    712 712
                     tags.append('bold')
    
    713 713
                     if not show_ascii_formatting_chars:
    
    714
    -                    special_text = special_text[2:-2] # remove /* */
    
    714
    +                    special_text = special_text[2:-2] # remove ~* *~
    
    715 715
                 elif special_text[1] == '_' and special_text[-2] == '_' and \
    
    716
    -            len(special_text) > 4: # it's also underlined
    
    717
    -                tags.append('underline')
    
    716
    +            len(special_text) > 4: # it's also italic
    
    717
    +                tags.append('italic')
    
    718 718
                     if not show_ascii_formatting_chars:
    
    719
    -                    special_text = special_text[2:-2] # remove /_ _/
    
    719
    +                    special_text = special_text[2:-2] # remove ~_ _~
    
    720 720
                 else:
    
    721 721
                     if not show_ascii_formatting_chars:
    
    722
    -                    special_text = special_text[1:-1] # remove / /
    
    723
    -        elif special_text.startswith('_'): # it's an underlined text
    
    724
    -            tags.append('underline')
    
    722
    +                    special_text = special_text[1:-1] # remove ~ ~
    
    723
    +        elif special_text.startswith('_'): # it's an italic text
    
    724
    +            tags.append('italic')
    
    725 725
                 if special_text[1] == '*' and special_text[-2] == '*' and \
    
    726 726
                 len(special_text) > 4: # it's also bold
    
    727 727
                     tags.append('bold')
    
    728 728
                     if not show_ascii_formatting_chars:
    
    729 729
                         special_text = special_text[2:-2] # remove _* *_
    
    730
    -            elif special_text[1] == '/' and special_text[-2] == '/' and \
    
    731
    -            len(special_text) > 4: # it's also italic
    
    732
    -                tags.append('italic')
    
    730
    +            elif special_text[1] == '~' and special_text[-2] == '~' and \
    
    731
    +            len(special_text) > 4: # it's also strikethrough
    
    732
    +                tags.append('strikethrough')
    
    733 733
                     if not show_ascii_formatting_chars:
    
    734
    -                    special_text = special_text[2:-2] # remove _/ /_
    
    734
    +                    special_text = special_text[2:-2] # remove _~ ~_
    
    735 735
                 else:
    
    736 736
                     if not show_ascii_formatting_chars:
    
    737 737
                         special_text = special_text[1:-1] # remove _ _
    

  • gajim/gui_interface.py
    ... ... @@ -1310,7 +1310,7 @@ def make_regexps(self):
    1310 1310
             # detects eg. *b* *bold* *bold bold* test *bold* *bold*! (*bold*)
    
    1311 1311
             # doesn't detect (it's a feature :P) * bold* *bold * * bold * test*bold*
    
    1312 1312
             formatting = r'|(?<!\w)' r'\*[^\s*]' r'([^*]*[^\s*])?' r'\*(?!\w)|'\
    
    1313
    -            r'(?<!\S)' r'/[^\s/]' r'([^/]*[^\s/])?' r'/(?!\S)|'\
    
    1313
    +            r'(?<!\S)' r'~[^\s~]' r'([^~]*[^\s~])?' r'~(?!\S)|'\
    
    1314 1314
                 r'(?<!\w)' r'_[^\s_]' r'([^_]*[^\s_])?' r'_(?!\w)'
    
    1315 1315
     
    
    1316 1316
             basic_pattern = links + '|' + mail + '|' + legacy_prefixes