From 10b30f6c14b73be4ef0a92cc72ceb06de66b5729 Mon Sep 17 00:00:00 2001 From: jasquat <2487833+jasquat@users.noreply.github.com> Date: Thu, 6 Jun 2024 10:40:50 -0400 Subject: [PATCH] remove the greater than symbol from the md sanitization method since it causes issues and does not seem to help w/ burnettk (#1685) Co-authored-by: jasquat --- .../src/spiffworkflow_backend/services/jinja_service.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/services/jinja_service.py b/spiffworkflow-backend/src/spiffworkflow_backend/services/jinja_service.py index 5f7b2e3a3..e2db4f8f3 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/services/jinja_service.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/services/jinja_service.py @@ -34,7 +34,10 @@ class JinjaHelpers: def sanitize_for_md(cls, value: str) -> str: """Sanitizes given value for markdown.""" # modified from https://github.com/python-telegram-bot/python-telegram-bot/blob/1fdaaac8094c9d76c34c8c8e8c9add16080e75e7/telegram/utils/helpers.py#L149 - escape_chars = r"_*[]()~`>#+-=|{}!" + # + # > was in this list but was removed because it doesn't seem to cause any + # issues and if it is in the list it prints like ">" instead + escape_chars = r"_*[]()~`#+-=|{}!" escaped_value = re.sub(f"([{re.escape(escape_chars)}])", r"\\\1", value) escaped_value = escaped_value.replace("\n", "").replace("\r", "") return escaped_value