Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mesonium
gajim
Commits
8e79f9f7
Verified
Commit
8e79f9f7
authored
4 years ago
by
André
Browse files
Options
Downloads
Patches
Plain Diff
Use styling directives as recommended in XEP-0393
Remove style *underline* and add style *strikethrough*. Fixes #7613.
parent
7056fecf
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gajim/conversation_textview.py
+21
-21
21 additions, 21 deletions
gajim/conversation_textview.py
gajim/gui_interface.py
+1
-1
1 addition, 1 deletion
gajim/gui_interface.py
with
22 additions
and
22 deletions
gajim/conversation_textview.py
+
21
−
21
View file @
8e79f9f7
...
@@ -194,8 +194,8 @@ def __init__(self, account, used_in_history_window=False):
...
@@ -194,8 +194,8 @@ def __init__(self, account, used_in_history_window=False):
tag
=
buffer_
.
create_tag
(
'
italic
'
)
tag
=
buffer_
.
create_tag
(
'
italic
'
)
tag
.
set_property
(
'
style
'
,
Pango
.
Style
.
ITALIC
)
tag
.
set_property
(
'
style
'
,
Pango
.
Style
.
ITALIC
)
tag
=
buffer_
.
create_tag
(
'
underline
'
)
tag
=
buffer_
.
create_tag
(
'
strikethrough
'
)
tag
.
set_property
(
'
underline
'
,
Pango
.
Underline
.
SINGLE
)
tag
.
set_property
(
'
strikethrough
'
,
True
)
buffer_
.
create_tag
(
'
focus-out-line
'
,
justification
=
Gtk
.
Justification
.
CENTER
)
buffer_
.
create_tag
(
'
focus-out-line
'
,
justification
=
Gtk
.
Justification
.
CENTER
)
self
.
displaymarking_tags
=
{}
self
.
displaymarking_tags
=
{}
...
@@ -692,46 +692,46 @@ def print_special_text(self, special_text, other_tags, graphics=True,
...
@@ -692,46 +692,46 @@ def print_special_text(self, special_text, other_tags, graphics=True,
tags
.
append
(
'
sth_at_sth
'
)
tags
.
append
(
'
sth_at_sth
'
)
elif
special_text
.
startswith
(
'
*
'
):
# it's a bold text
elif
special_text
.
startswith
(
'
*
'
):
# it's a bold text
tags
.
append
(
'
bold
'
)
tags
.
append
(
'
bold
'
)
if
special_text
[
1
]
==
'
/
'
and
special_text
[
-
2
]
==
'
/
'
and
\
if
special_text
[
1
]
==
'
~
'
and
special_text
[
-
2
]
==
'
~
'
and
\
len
(
special_text
)
>
4
:
# it's also
italic
len
(
special_text
)
>
4
:
# it's also
strikethrough
tags
.
append
(
'
italic
'
)
tags
.
append
(
'
strikethrough
'
)
if
not
show_ascii_formatting_chars
:
if
not
show_ascii_formatting_chars
:
special_text
=
special_text
[
2
:
-
2
]
# remove *
/ /
*
special_text
=
special_text
[
2
:
-
2
]
# remove *
~ ~
*
elif
special_text
[
1
]
==
'
_
'
and
special_text
[
-
2
]
==
'
_
'
and
\
elif
special_text
[
1
]
==
'
_
'
and
special_text
[
-
2
]
==
'
_
'
and
\
len
(
special_text
)
>
4
:
# it's also
underlined
len
(
special_text
)
>
4
:
# it's also
italic
tags
.
append
(
'
underline
'
)
tags
.
append
(
'
italic
'
)
if
not
show_ascii_formatting_chars
:
if
not
show_ascii_formatting_chars
:
special_text
=
special_text
[
2
:
-
2
]
# remove *_ _*
special_text
=
special_text
[
2
:
-
2
]
# remove *_ _*
else
:
else
:
if
not
show_ascii_formatting_chars
:
if
not
show_ascii_formatting_chars
:
special_text
=
special_text
[
1
:
-
1
]
# remove * *
special_text
=
special_text
[
1
:
-
1
]
# remove * *
elif
special_text
.
startswith
(
'
/
'
):
# it's a
n italic
text
elif
special_text
.
startswith
(
'
~
'
):
# it's a
strikethrough
text
tags
.
append
(
'
italic
'
)
tags
.
append
(
'
strikethrough
'
)
if
special_text
[
1
]
==
'
*
'
and
special_text
[
-
2
]
==
'
*
'
and
\
if
special_text
[
1
]
==
'
*
'
and
special_text
[
-
2
]
==
'
*
'
and
\
len
(
special_text
)
>
4
:
# it's also bold
len
(
special_text
)
>
4
:
# it's also bold
tags
.
append
(
'
bold
'
)
tags
.
append
(
'
bold
'
)
if
not
show_ascii_formatting_chars
:
if
not
show_ascii_formatting_chars
:
special_text
=
special_text
[
2
:
-
2
]
# remove
/
* *
/
special_text
=
special_text
[
2
:
-
2
]
# remove
~
* *
~
elif
special_text
[
1
]
==
'
_
'
and
special_text
[
-
2
]
==
'
_
'
and
\
elif
special_text
[
1
]
==
'
_
'
and
special_text
[
-
2
]
==
'
_
'
and
\
len
(
special_text
)
>
4
:
# it's also
underlined
len
(
special_text
)
>
4
:
# it's also
italic
tags
.
append
(
'
underline
'
)
tags
.
append
(
'
italic
'
)
if
not
show_ascii_formatting_chars
:
if
not
show_ascii_formatting_chars
:
special_text
=
special_text
[
2
:
-
2
]
# remove
/
_ _
/
special_text
=
special_text
[
2
:
-
2
]
# remove
~
_ _
~
else
:
else
:
if
not
show_ascii_formatting_chars
:
if
not
show_ascii_formatting_chars
:
special_text
=
special_text
[
1
:
-
1
]
# remove
/ /
special_text
=
special_text
[
1
:
-
1
]
# remove
~ ~
elif
special_text
.
startswith
(
'
_
'
):
# it's an
underlined
text
elif
special_text
.
startswith
(
'
_
'
):
# it's an
italic
text
tags
.
append
(
'
underline
'
)
tags
.
append
(
'
italic
'
)
if
special_text
[
1
]
==
'
*
'
and
special_text
[
-
2
]
==
'
*
'
and
\
if
special_text
[
1
]
==
'
*
'
and
special_text
[
-
2
]
==
'
*
'
and
\
len
(
special_text
)
>
4
:
# it's also bold
len
(
special_text
)
>
4
:
# it's also bold
tags
.
append
(
'
bold
'
)
tags
.
append
(
'
bold
'
)
if
not
show_ascii_formatting_chars
:
if
not
show_ascii_formatting_chars
:
special_text
=
special_text
[
2
:
-
2
]
# remove _* *_
special_text
=
special_text
[
2
:
-
2
]
# remove _* *_
elif
special_text
[
1
]
==
'
/
'
and
special_text
[
-
2
]
==
'
/
'
and
\
elif
special_text
[
1
]
==
'
~
'
and
special_text
[
-
2
]
==
'
~
'
and
\
len
(
special_text
)
>
4
:
# it's also
italic
len
(
special_text
)
>
4
:
# it's also
strikethrough
tags
.
append
(
'
italic
'
)
tags
.
append
(
'
strikethrough
'
)
if
not
show_ascii_formatting_chars
:
if
not
show_ascii_formatting_chars
:
special_text
=
special_text
[
2
:
-
2
]
# remove _
/ /
_
special_text
=
special_text
[
2
:
-
2
]
# remove _
~ ~
_
else
:
else
:
if
not
show_ascii_formatting_chars
:
if
not
show_ascii_formatting_chars
:
special_text
=
special_text
[
1
:
-
1
]
# remove _ _
special_text
=
special_text
[
1
:
-
1
]
# remove _ _
...
...
This diff is collapsed.
Click to expand it.
gajim/gui_interface.py
+
1
−
1
View file @
8e79f9f7
...
@@ -1310,7 +1310,7 @@ def make_regexps(self):
...
@@ -1310,7 +1310,7 @@ def make_regexps(self):
# detects eg. *b* *bold* *bold bold* test *bold* *bold*! (*bold*)
# detects eg. *b* *bold* *bold bold* test *bold* *bold*! (*bold*)
# doesn't detect (it's a feature :P) * bold* *bold * * bold * test*bold*
# doesn't detect (it's a feature :P) * bold* *bold * * bold * test*bold*
formatting
=
r
'
|(?<!\w)
'
r
'
\*[^\s*]
'
r
'
([^*]*[^\s*])?
'
r
'
\*(?!\w)|
'
\
formatting
=
r
'
|(?<!\w)
'
r
'
\*[^\s*]
'
r
'
([^*]*[^\s*])?
'
r
'
\*(?!\w)|
'
\
r
'
(?<!\S)
'
r
'
/
[^\s
/
]
'
r
'
([^
/
]*[^\s
/
])?
'
r
'
/
(?!\S)|
'
\
r
'
(?<!\S)
'
r
'
~
[^\s
~
]
'
r
'
([^
~
]*[^\s
~
])?
'
r
'
~
(?!\S)|
'
\
r
'
(?<!\w)
'
r
'
_[^\s_]
'
r
'
([^_]*[^\s_])?
'
r
'
_(?!\w)
'
r
'
(?<!\w)
'
r
'
_[^\s_]
'
r
'
([^_]*[^\s_])?
'
r
'
_(?!\w)
'
basic_pattern
=
links
+
'
|
'
+
mail
+
'
|
'
+
legacy_prefixes
basic_pattern
=
links
+
'
|
'
+
mail
+
'
|
'
+
legacy_prefixes
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment