Let a fenced # sit inside a section

This commit is contained in:
2026-09-24 22:19:02 +02:00
parent 7f30bdf8a0
commit 1849efc894
+4 -3
View File
@@ -79,12 +79,13 @@ JUDGE_SCHEMA = {
def sections(text):
found, current = {}, None
found, current, fenced = {}, None, False
for line in text.splitlines():
if line.startswith("## "):
fenced ^= line.startswith("```")
if not fenced and line.startswith("## "):
current = line.strip()[3:]
found[current] = []
elif line.startswith("#"):
elif not fenced and line.startswith("#"):
current = None
elif current and line.strip():
found[current].append(line)