Fix || usage in help entries. Resolve #3085

This commit is contained in:
Griatch 2023-02-26 17:39:36 +01:00
parent 30707a6b56
commit bb9dc516b9
5 changed files with 18 additions and 16 deletions

View file

@ -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)

View file

@ -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)

View file

@ -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)