Fixed a non-functioning MXP call using the |-style format.
This commit is contained in:
parent
5f0ba55ce1
commit
8709ffefb8
2 changed files with 3 additions and 2 deletions
|
|
@ -17,6 +17,7 @@ from builtins import object
|
||||||
import re
|
import re
|
||||||
|
|
||||||
LINKS_SUB = re.compile(r'\{lc(.*?)\{lt(.*?)\{le', re.DOTALL)
|
LINKS_SUB = re.compile(r'\{lc(.*?)\{lt(.*?)\{le', re.DOTALL)
|
||||||
|
LINKS_SUB2 = re.compile(r'\|lc(.*?)\|lt(.*?)\|le', re.DOTALL)
|
||||||
|
|
||||||
MXP = "\x5B"
|
MXP = "\x5B"
|
||||||
MXP_TEMPSECURE = "\x1B[4z"
|
MXP_TEMPSECURE = "\x1B[4z"
|
||||||
|
|
@ -42,6 +43,7 @@ def mxp_parse(text):
|
||||||
.replace(">", ">")
|
.replace(">", ">")
|
||||||
|
|
||||||
text = LINKS_SUB.sub(MXP_SEND, text)
|
text = LINKS_SUB.sub(MXP_SEND, text)
|
||||||
|
text = LINKS_SUB2.sub(MXP_SEND, text)
|
||||||
return text
|
return text
|
||||||
|
|
||||||
class Mxp(object):
|
class Mxp(object):
|
||||||
|
|
|
||||||
|
|
@ -138,7 +138,6 @@ class ANSIParser(object):
|
||||||
if use_xterm256:
|
if use_xterm256:
|
||||||
colval = 16 + (red * 36) + (green * 6) + blue
|
colval = 16 + (red * 36) + (green * 6) + blue
|
||||||
return "\033[%s8;5;%s%s%sm" % (3 + int(background), colval // 100, (colval % 100) // 10, colval%10)
|
return "\033[%s8;5;%s%s%sm" % (3 + int(background), colval // 100, (colval % 100) // 10, colval%10)
|
||||||
#return "\033[%s8;5;%sm" % (3 + int(background), colval)
|
|
||||||
else:
|
else:
|
||||||
# xterm256 not supported, convert the rgb value to ansi instead
|
# xterm256 not supported, convert the rgb value to ansi instead
|
||||||
if red == green == blue and red < 3:
|
if red == green == blue and red < 3:
|
||||||
|
|
@ -436,7 +435,7 @@ class ANSIParser(object):
|
||||||
]
|
]
|
||||||
|
|
||||||
mxp_re = r'\{lc(.*?)\{lt(.*?)\{le|' \
|
mxp_re = r'\{lc(.*?)\{lt(.*?)\{le|' \
|
||||||
+ r'\|lc(.*?)\|lt(.*?)\|le'
|
r'\|lc(.*?)\|lt(.*?)\|le'
|
||||||
|
|
||||||
# prepare regex matching
|
# prepare regex matching
|
||||||
brightbg_sub = re.compile(r"|".join([re.escape(tup[0]) for tup in ansi_bright_bgs]), re.DOTALL)
|
brightbg_sub = re.compile(r"|".join([re.escape(tup[0]) for tup in ansi_bright_bgs]), re.DOTALL)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue