X-Git-Url: https://mudpy.org/gitweb?p=mudpy.git;a=blobdiff_plain;f=lib%2Fmudpy%2Fmisc.py;fp=lib%2Fmudpy%2Fmisc.py;h=ed205a2f038d2532848ea3a330b255aaf31fa536;hp=bcb50c2e86234db48243420d0caed5f6f251d13d;hb=3b16769152e6f5bff553a37d0e69f35dee28dc29;hpb=0cda64117ac0b79b8c8f16a37ec3f9316f4c4d16 diff --git a/lib/mudpy/misc.py b/lib/mudpy/misc.py index bcb50c2..ed205a2 100644 --- a/lib/mudpy/misc.py +++ b/lib/mudpy/misc.py @@ -1,6 +1,6 @@ """Miscellaneous functions for the mudpy engine.""" -# Copyright (c) 2004-2015 Jeremy Stanley . Permission +# Copyright (c) 2004-2016 Jeremy Stanley . Permission # to use, copy, modify, and distribute this software is granted under # terms provided in the LICENSE file distributed with this software. @@ -1342,9 +1342,12 @@ def replace_macros(user, text, is_input=False): return text -def escape_macros(text): +def escape_macros(value): """Escapes replacement macros in text.""" - return text.replace("$(", "$_(") + if type(value) is str: + return value.replace("$(", "$_(") + else: + return value def first_word(text, separator=" "):