Let a fenced # sit inside a section
This commit is contained in:
+4
-3
@@ -79,12 +79,13 @@ JUDGE_SCHEMA = {
|
|||||||
|
|
||||||
|
|
||||||
def sections(text):
|
def sections(text):
|
||||||
found, current = {}, None
|
found, current, fenced = {}, None, False
|
||||||
for line in text.splitlines():
|
for line in text.splitlines():
|
||||||
if line.startswith("## "):
|
fenced ^= line.startswith("```")
|
||||||
|
if not fenced and line.startswith("## "):
|
||||||
current = line.strip()[3:]
|
current = line.strip()[3:]
|
||||||
found[current] = []
|
found[current] = []
|
||||||
elif line.startswith("#"):
|
elif not fenced and line.startswith("#"):
|
||||||
current = None
|
current = None
|
||||||
elif current and line.strip():
|
elif current and line.strip():
|
||||||
found[current].append(line)
|
found[current].append(line)
|
||||||
|
|||||||
Reference in New Issue
Block a user