Be more careful when stripping newline added by pygments.
Calls rstrip() instead of cutting of the last character blindly, so that: 1. Potentially multiple trailing whitespace of any kind will get stripped. 2. We don't chop off a non-whitespace character, in case pygments' changes.
This commit is contained in:
parent
96e8f5246b
commit
041c15e811
1 changed files with 1 additions and 1 deletions
|
@ -313,7 +313,7 @@ class Formatted(object):
|
||||||
# highlight adds a newline to the end of the string, remove it
|
# highlight adds a newline to the end of the string, remove it
|
||||||
# from the output
|
# from the output
|
||||||
return highlight(string, lexer,
|
return highlight(string, lexer,
|
||||||
WeechatFormatter(style=style))[:-1]
|
WeechatFormatter(style=style)).rstrip()
|
||||||
elif name == "fgcolor":
|
elif name == "fgcolor":
|
||||||
return "{color_on}{text}{color_off}".format(
|
return "{color_on}{text}{color_off}".format(
|
||||||
color_on=W.color(value),
|
color_on=W.color(value),
|
||||||
|
|
Loading…
Add table
Reference in a new issue