mkdocs_hooks: Improve check for not in a list
Look for lines that don't start with a list and don't start with a space to check for the end of a list. This fixes the rendering of the list in BLTouch.md . Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
36e3969219
commit
3176150050
|
@ -28,7 +28,7 @@ def transform(markdown: str, page, config, files):
|
||||||
line_out = re.sub("\\\s*$", "<br>", line_out)
|
line_out = re.sub("\\\s*$", "<br>", line_out)
|
||||||
# check that lists at level 0 are not indented
|
# check that lists at level 0 are not indented
|
||||||
# (no space before *|-|1.)
|
# (no space before *|-|1.)
|
||||||
if len(line_out) == 0:
|
if re.match(r"^[^-*0-9 ]", line_out):
|
||||||
in_list = False
|
in_list = False
|
||||||
elif re.match(r"^(\*|-|\d+\.) ", line_out):
|
elif re.match(r"^(\*|-|\d+\.) ", line_out):
|
||||||
in_list = True
|
in_list = True
|
||||||
|
|
Loading…
Reference in New Issue