Skip to content

Commit

Permalink
mkdocs_hooks: Improve check for not in a list
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
KevinOConnor committed Aug 2, 2021
1 parent 36e3969 commit 3176150
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/_klipper3d/mkdocs_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def transform(markdown: str, page, config, files):
line_out = re.sub("\\\s*$", "<br>", line_out)
# check that lists at level 0 are not indented
# (no space before *|-|1.)
if len(line_out) == 0:
if re.match(r"^[^-*0-9 ]", line_out):
in_list = False
elif re.match(r"^(\*|-|\d+\.) ", line_out):
in_list = True
Expand Down

0 comments on commit 3176150

Please sign in to comment.