From d2f8e40b4209515a7446762a106ce733d16f93a4 Mon Sep 17 00:00:00 2001 From: Michael Haslam Date: Thu, 7 Apr 2022 19:02:56 +0100 Subject: [PATCH] Add a check to the current selection at the end, not just the start. --- tkintermd/tkintermd_frame.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tkintermd/tkintermd_frame.py b/tkintermd/tkintermd_frame.py index e50b2a9..9aa5da2 100644 --- a/tkintermd/tkintermd_frame.py +++ b/tkintermd/tkintermd_frame.py @@ -383,7 +383,7 @@ def check_bold_italic(self, md_syntax, md_ignore, md_special): # Ignore items in the md_ignore variable and then deal with special # syntax individually. If string starts with anything in md_ignore do # nothing and return from the function. - if str(self.cur_selection).startswith(self.md_ignore): + if str(self.cur_selection).startswith(self.md_ignore) or str(self.cur_selection).endswith(self.md_ignore): return # If the formatting requires special items which can't go in md_ignore # because they cause issues with markdown being applied incorrectly.