From 191c7c423f0991e90084172855234896f4f8585a Mon Sep 17 00:00:00 2001 From: loris-intergalactique <51478929+loris-intergalactique@users.noreply.github.com> Date: Thu, 15 Aug 2024 17:25:17 +0200 Subject: [PATCH] Adapt Entangled.py to Obsidian Code Styler Plugin --- entangled/hooks/shebang.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/entangled/hooks/shebang.py b/entangled/hooks/shebang.py index 145f14b..2828cac 100644 --- a/entangled/hooks/shebang.py +++ b/entangled/hooks/shebang.py @@ -5,6 +5,11 @@ class Hook(HookBase): def on_read(self, code: CodeBlock): lines = code.source.splitlines() + if len(lines) == 0: + return + if lines[0].startswith("#!"): code.header = lines[0] code.source = "\n".join(lines[1:]) + + return