Fixed a non-functioning MXP call using the |-style format.

This commit is contained in:
Griatch 2016-04-02 15:20:40 +02:00
parent 5f0ba55ce1
commit 8709ffefb8
2 changed files with 3 additions and 2 deletions

View file

@ -17,6 +17,7 @@ from builtins import object
import re
LINKS_SUB = re.compile(r'\{lc(.*?)\{lt(.*?)\{le', re.DOTALL)
LINKS_SUB2 = re.compile(r'\|lc(.*?)\|lt(.*?)\|le', re.DOTALL)
MXP = "\x5B"
MXP_TEMPSECURE = "\x1B[4z"
@ -42,6 +43,7 @@ def mxp_parse(text):
.replace(">", ">")
text = LINKS_SUB.sub(MXP_SEND, text)
text = LINKS_SUB2.sub(MXP_SEND, text)
return text
class Mxp(object):

View file

@ -138,7 +138,6 @@ class ANSIParser(object):
if use_xterm256:
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;%sm" % (3 + int(background), colval)
else:
# xterm256 not supported, convert the rgb value to ansi instead
if red == green == blue and red < 3:
@ -436,7 +435,7 @@ class ANSIParser(object):
]
mxp_re = r'\{lc(.*?)\{lt(.*?)\{le|' \
+ r'\|lc(.*?)\|lt(.*?)\|le'
r'\|lc(.*?)\|lt(.*?)\|le'
# prepare regex matching
brightbg_sub = re.compile(r"|".join([re.escape(tup[0]) for tup in ansi_bright_bgs]), re.DOTALL)