10 import re |
10 import re |
11 |
11 |
12 from PyQt6.QtCore import QCoreApplication, QTime |
12 from PyQt6.QtCore import QCoreApplication, QTime |
13 from PyQt6.QtWidgets import QApplication |
13 from PyQt6.QtWidgets import QApplication |
14 |
14 |
15 from eric7 import Preferences, Utilities |
15 from eric7 import EricUtilities, Preferences |
16 |
16 |
17 __UrlRe = re.compile( |
17 __UrlRe = re.compile( |
18 r"""((?:http|ftp|https):\/\/[\w\-_]+(?:\.[\w\-_]+)+""" |
18 r"""((?:http|ftp|https):\/\/[\w\-_]+(?:\.[\w\-_]+)+""" |
19 r"""(?:[\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?)""" |
19 r"""(?:[\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?)""" |
20 ) |
20 ) |
58 @type str |
58 @type str |
59 @return processed message |
59 @return processed message |
60 @rtype str |
60 @rtype str |
61 """ |
61 """ |
62 # step 1: cleanup message |
62 # step 1: cleanup message |
63 msg = Utilities.html_encode(msg) |
63 msg = EricUtilities.html_encode(msg) |
64 |
64 |
65 # step 2: replace IRC formatting characters |
65 # step 2: replace IRC formatting characters |
66 openTags = [] |
66 openTags = [] |
67 parts = __ColorRe.split(msg) |
67 parts = __ColorRe.split(msg) |
68 msgParts = [] |
68 msgParts = [] |