From 7d5578e20449076dff42d72bc9a4e95a32bffa42 Mon Sep 17 00:00:00 2001 From: The Wobbler Date: Thu, 10 Apr 2025 11:23:11 +0200 Subject: [PATCH] Improved codeblock detection. --- omg.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/omg.py b/omg.py index 14a6c79..4ecf296 100755 --- a/omg.py +++ b/omg.py @@ -97,8 +97,10 @@ class OMG: if line == "": continue - if line.startswith("```"): # detect codeblocks and ignore everything inside it - codeblock = not codeblock + if "```" in line: # detect codeblocks and ignore everything inside it + if not "```" in line[line.find("```"):]: + codeblock = not codeblock + continue if codeblock: