diff --git a/pandocFilter/pandocFilter.py b/pandocFilter/pandocFilter.py
index c8e3032ab80c131c8df62b500c4cd63a8e10e855..05a504c08761e01348d70b26d8be507bc80907c1 100644
--- a/pandocFilter/pandocFilter.py
+++ b/pandocFilter/pandocFilter.py
@@ -58,6 +58,7 @@ def correctTOC(progress:Progress, mdLines:list[str], tocSection:str = 'Contents'
 		if _inTOC:
 			if line.startswith('#'):	# End of TOC?
 				_inTOC = False
+				_lines.append(f'\n')
 				_lines.append(line)
 				continue
 			matches = re.findall(tocregex, line)	# Replace entry