fix(markdown): skip empty bold headings

This commit is contained in:
BukeLy 2026-07-16 19:36:52 +08:00
parent 6fd237986e
commit 01dbcbf47f
2 changed files with 26 additions and 2 deletions

View file

@ -0,0 +1,23 @@
import unittest
from pageindex.page_index_md import extract_nodes_from_markdown
class ExtractNodesFromMarkdownTest(unittest.TestCase):
def test_skips_bold_heading_with_only_whitespace(self):
nodes, _ = extract_nodes_from_markdown("** **\n**Valid heading**")
self.assertEqual(
nodes,
[
{
"node_title": "Valid heading",
"line_num": 2,
"level": 1,
}
],
)
if __name__ == "__main__":
unittest.main()