Skip to content

Commit

Permalink
Try to fix failing tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
HaudinFlorence committed Oct 25, 2024
1 parent 6fbb968 commit 5708233
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions nbconvert/filters/markdown_mistune.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,30 +519,30 @@ def extract_titles_from_notebook_node(nb: NotebookNode):
if line.startswith('#') and line.count('#') != 1: # exclude the main title to build the table of content
markdown_collection = markdown_collection + line.strip() + "\n"
if line.startswith('<h2>'):
line = line.replace("<h2>", "# ")
newline = line.replace("<h2>", "# ")
if line.startswith('<h3>'):
line = line.replace("<h3>", "# ")
newline = line.replace("<h3>", "# ")
if line.startswith('<h4>'):
line = line.replace("<h4>", "# ")
newline = line.replace("<h4>", "# ")
if line.startswith('<h5>'):
line = line.replace("<h5>", "# ")
newline = line.replace("<h5>", "# ")
if line.startswith('<h6>'):
line = line.replace("<h6>", "# ")
newline = line.replace("<h6>", "# ")
if '</h2>' in line:
line = line.replace("</h2>", "")
markdown_collection = markdown_collection + line.strip() + "\n"
newline = line.replace("</h2>", "")
markdown_collection = markdown_collection + newline.strip() + "\n"
if '</h3>' in line:
line = line.replace("</h3>", "")
markdown_collection = markdown_collection + line.strip() + "\n"
newline = line.replace("</h3>", "")
markdown_collection = markdown_collection + newline.strip() + "\n"
if '</h4>' in line:
line = line.replace("</h4>", "")
markdown_collection = markdown_collection + line.strip() + "\n"
newline = line.replace("</h4>", "")
markdown_collection = markdown_collection + newline.strip() + "\n"
if '</h5>' in line:
line = line.replace("</h5>", "")
markdown_collection = markdown_collection + line.strip() + "\n"
newline = line.replace("</h5>", "")
markdown_collection = markdown_collection + newline.strip() + "\n"
if '</h6>' in line:
line = line.replace("</h6>", "")
markdown_collection = markdown_collection + line.strip() + "\n"
newline = line.replace("</h6>", "")
markdown_collection = markdown_collection + newline.strip() + "\n"

titles_array = []
renderer = HeadingExtractor()
Expand Down

0 comments on commit 5708233

Please sign in to comment.