mirror of
https://github.com/VectifyAI/PageIndex.git
synced 2026-07-24 21:41:04 +02:00
Merge pull request #250 from VectifyAI/feat/md-bold-heading-recognition
Recognize whole-line bold as level-1 heading in markdown parser
This commit is contained in:
commit
c58cd62b50
2 changed files with 35 additions and 10 deletions
23
tests/test_page_index_md.py
Normal file
23
tests/test_page_index_md.py
Normal 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()
|
||||
Loading…
Add table
Add a link
Reference in a new issue