From 68d908c4f21d8bf277a39d121c23db635e1aa0a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Sun, 6 Feb 2022 15:36:12 +0100 Subject: [PATCH] add escape char attribute --- PyTeX/format/formatting_config.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/PyTeX/format/formatting_config.py b/PyTeX/format/formatting_config.py index c3e734a..38afef3 100644 --- a/PyTeX/format/formatting_config.py +++ b/PyTeX/format/formatting_config.py @@ -30,6 +30,8 @@ class FormattingConfig(Config): self._include_ins: Optional[bool] = True self._use_docstrip_guards: Optional[List[str]] = None + self._escape_character: Optional[str] = None + def merge_with(self, other, strict: bool = False): """ Merges the other config into this one @@ -182,6 +184,13 @@ class FormattingConfig(Config): else: return self._use_docstrip_guards + @property + def escape_character(self) -> str: + if self._escape_character is None: + return '!' + else: + return self._escape_character + class DocFormattingConfig: def __init__(self):