From 72619e26548748892b4190ff0cd3d74991803f4d Mon Sep 17 00:00:00 2001 From: 44229 <442292066@qq.com> Date: Tue, 24 Aug 2021 09:23:28 +0800 Subject: [PATCH 1/2] Typora's `dockerfile` to notion's `Docker` --- md2notion/NotionPyRenderer.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/md2notion/NotionPyRenderer.py b/md2notion/NotionPyRenderer.py index 600362e..d45dc45 100644 --- a/md2notion/NotionPyRenderer.py +++ b/md2notion/NotionPyRenderer.py @@ -187,6 +187,9 @@ def render_block_code(self, token): ] if token.language != "": matchLang = next((lang for lang in notionSoLangs if re.match(re.escape(token.language), lang, re.I)), "") + if token.language == "dockerfile": + matchLang = "Docker" + print(f"{token.language} to {matchLang}") if not matchLang: print(f"Code block language {token.language} has no corresponding syntax in Notion.so") else: From 02452e871875beaf868e10c655a14169d786d631 Mon Sep 17 00:00:00 2001 From: Cobertos / Samantha Date: Tue, 5 Oct 2021 03:30:24 -0400 Subject: [PATCH 2/2] Added comment clarifying extra conditional --- md2notion/NotionPyRenderer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/md2notion/NotionPyRenderer.py b/md2notion/NotionPyRenderer.py index d45dc45..f9fe145 100644 --- a/md2notion/NotionPyRenderer.py +++ b/md2notion/NotionPyRenderer.py @@ -187,7 +187,7 @@ def render_block_code(self, token): ] if token.language != "": matchLang = next((lang for lang in notionSoLangs if re.match(re.escape(token.language), lang, re.I)), "") - if token.language == "dockerfile": + if token.language == "dockerfile": # Typora uses `dockerfile` matchLang = "Docker" print(f"{token.language} to {matchLang}") if not matchLang: