diff --git a/evennia/utils/nested_inlinefuncs.py b/evennia/utils/nested_inlinefuncs.py index b182866bc..d36c5a7f4 100644 --- a/evennia/utils/nested_inlinefuncs.py +++ b/evennia/utils/nested_inlinefuncs.py @@ -189,7 +189,7 @@ _RE_TOKEN = re.compile(r""" (?P(?(?\\'|\\"|\\\)|\\$\w+\()| # escaped tokens should re-appear in text - (?P[\w\s.-\/#!%\^&\*;:=\-\"\'_`~\(}{\[\]]+) # everything else should also be included""", + (?P[\w\s.-\/#!%\^&\*;:=\-_`~\(}{\[\]]+|\"{1}|\'{1}) # everything else should also be included""", re.UNICODE + re.IGNORECASE + re.VERBOSE + re.DOTALL) diff --git a/evennia/utils/tests.py b/evennia/utils/tests.py index 300b5dc38..1cd5074ee 100644 --- a/evennia/utils/tests.py +++ b/evennia/utils/tests.py @@ -336,5 +336,10 @@ class TestNestedInlineFuncs(TestCase): def test_escaped(self): self.assertEqual(nested_inlinefuncs.parse_inlinefunc( - "this should be $pad('''escaped,''' and \"\"\"instead,\"\"\" cropped $crop(with a long,5) text., 80)"), + "this should be $pad('''escaped,''' and '''instead,''' cropped $crop(with a long,5) text., 80)"), + "this should be escaped, and instead, cropped with text. ") + + def test_escaped2(self): + self.assertEqual(nested_inlinefuncs.parse_inlinefunc( + 'this should be $pad("""escaped,""" and """instead,""" cropped $crop(with a long,5) text., 80)'), "this should be escaped, and instead, cropped with text. ")