diff --git a/CHANGELOG.md b/CHANGELOG.md index ac5358d75f..2b0803f38c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Main branch (git) +- Bug fix: || (escaped color tags) were parsed too early in help entries, + leading to colors when wanting a | separator - Bug fix: Make sure spawned objects get `typeclass_path` pointing to the true location rather than alias (in line with `create_object`). - Bug fix: Building Menu contrib menu no using Replace over Union mergetype to diff --git a/docs/source/Coding/Changelog.md b/docs/source/Coding/Changelog.md index 725db0b217..2b0803f38c 100644 --- a/docs/source/Coding/Changelog.md +++ b/docs/source/Coding/Changelog.md @@ -2,6 +2,12 @@ ## Main branch (git) +- Bug fix: || (escaped color tags) were parsed too early in help entries, + leading to colors when wanting a | separator +- Bug fix: Make sure spawned objects get `typeclass_path` pointing to the true + location rather than alias (in line with `create_object`). +- Bug fix: Building Menu contrib menu no using Replace over Union mergetype to + avoid clashing with in-game commands while building - Feature: RPSystem contrib `sdesc` command can now view/delete your sdesc. - Bug fix: Change so `script obj = [scriptname|id]` is required to manipulate scripts on objects; `script scriptname|id` only works on global scripts. diff --git a/evennia/commands/default/help.py b/evennia/commands/default/help.py index 85fcaeac0d..4f31f0ab24 100644 --- a/evennia/commands/default/help.py +++ b/evennia/commands/default/help.py @@ -13,20 +13,13 @@ from dataclasses import dataclass from itertools import chain from django.conf import settings - from evennia.help.filehelp import FILE_HELP_ENTRIES from evennia.help.models import HelpEntry from evennia.help.utils import help_search_with_index, parse_entry_for_subcategories from evennia.utils import create, evmore from evennia.utils.ansi import ANSIString from evennia.utils.eveditor import EvEditor -from evennia.utils.utils import ( - class_from_module, - dedent, - format_grid, - inherits_from, - pad, -) +from evennia.utils.utils import class_from_module, dedent, format_grid, inherits_from, pad CMD_IGNORE_PREFIXES = settings.CMD_IGNORE_PREFIXES COMMAND_DEFAULT_CLASS = class_from_module(settings.COMMAND_DEFAULT_CLASS) diff --git a/evennia/server/portal/telnet.py b/evennia/server/portal/telnet.py index cb577f3835..98a095833c 100644 --- a/evennia/server/portal/telnet.py +++ b/evennia/server/portal/telnet.py @@ -10,6 +10,11 @@ sessions etc. import re from django.conf import settings +from evennia.server.portal import mssp, naws, suppress_ga, telnet_oob, ttype +from evennia.server.portal.mccp import MCCP, Mccp, mccp_compress +from evennia.server.portal.mxp import Mxp, mxp_parse +from evennia.utils import ansi +from evennia.utils.utils import class_from_module, to_bytes from twisted.conch.telnet import ( ECHO, GA, @@ -28,12 +33,6 @@ from twisted.conch.telnet import ( from twisted.internet import protocol from twisted.internet.task import LoopingCall -from evennia.server.portal import mssp, naws, suppress_ga, telnet_oob, ttype -from evennia.server.portal.mccp import MCCP, Mccp, mccp_compress -from evennia.server.portal.mxp import Mxp, mxp_parse -from evennia.utils import ansi -from evennia.utils.utils import class_from_module, to_bytes - _RE_N = re.compile(r"\|n$") _RE_LEND = re.compile(rb"\n$|\r$|\r\n$|\r\x00$|", re.MULTILINE) _RE_LINEBREAK = re.compile(rb"\n\r|\r\n|\n|\r", re.DOTALL + re.MULTILINE) diff --git a/evennia/utils/evmore.py b/evennia/utils/evmore.py index 4e89ef2deb..7d445bec98 100644 --- a/evennia/utils/evmore.py +++ b/evennia/utils/evmore.py @@ -40,7 +40,6 @@ from django.conf import settings from django.core.paginator import Paginator from django.db.models.query import QuerySet from django.utils.translation import gettext as _ - from evennia.commands import cmdhandler from evennia.commands.cmdset import CmdSet from evennia.commands.command import Command @@ -435,8 +434,11 @@ class EvMore(object): # no justification. Simple division by line lines = text.split("\n") + # note: If joining on ANSIString here, we will parse out || escapes into | too early, + # meaning the protocol will later parse into color; better to leave things and only parse + # once. self._data = [ - _LBR.join(lines[i : i + self.height]) for i in range(0, len(lines), self.height) + "\n".join(lines[i : i + self.height]) for i in range(0, len(lines), self.height) ] self._npages = len(self._data)