diff --git a/nbconvert/exporters/templateexporter.py b/nbconvert/exporters/templateexporter.py index 0b8c27f41..da932a507 100644 --- a/nbconvert/exporters/templateexporter.py +++ b/nbconvert/exporters/templateexporter.py @@ -685,5 +685,3 @@ def _init_resources(self, resources): def include_tableofcontents(self): return True - - diff --git a/nbconvert/filters/markdown_mistune.py b/nbconvert/filters/markdown_mistune.py index 8deae6169..3d5019916 100644 --- a/nbconvert/filters/markdown_mistune.py +++ b/nbconvert/filters/markdown_mistune.py @@ -501,6 +501,7 @@ def heading(self, text, level): self.headings.append((level, text)) return "" # We return an empty string to avoid outputting the headings + def extract_titles_from_markdown_input(markdown_input): # Markdown_input is a single string with all the markdown content concatenated # Initiate list of titles @@ -523,7 +524,7 @@ def extract_titles_from_markdown_input(markdown_input): attrs = title["attrs"] raw_text = children[0]["raw"] level = attrs["level"] - id = raw_text.replace(' ', '-') - href= "#" + id + id = raw_text.replace(" ", "-") + href = "#" + id titles_array.append([level, raw_text, id, href]) return titles_array diff --git a/share/templates/lab/index.html.j2 b/share/templates/lab/index.html.j2 index 8be92ffa0..681631cf9 100644 --- a/share/templates/lab/index.html.j2 +++ b/share/templates/lab/index.html.j2 @@ -136,7 +136,7 @@ a.anchor-link { {{text}} -{%- endif -%} +{%- endif -%} {%- if level==2 -%}
diff --git a/share/templates/lab/static/index.css b/share/templates/lab/static/index.css index b495e0eb1..fedf510a9 100644 --- a/share/templates/lab/static/index.css +++ b/share/templates/lab/static/index.css @@ -6800,4 +6800,3 @@ div.jp-Cell-Placeholder-content-2 { div.jp-Cell-Placeholder-content-3 { top: 140px; } -