feat: also support tags in further blocks

Signed-off-by: Konstantin Fickel <mail@konstantinfickel.de>
This commit is contained in:
Konstantin Fickel 2025-06-20 16:15:11 +02:00
parent 42262844a6
commit b7ad75f079
2 changed files with 64 additions and 27 deletions

View file

@ -78,7 +78,7 @@ class TestParseProcess:
)
def test_parse_split_paragraphs_into_shards(self):
file_text = f"Hello World!\n\n@Tag1 Block 1\n\n@Tag2 Block 2"
file_text = "Hello World!\n\n@Tag1 Block 1\n\n@Tag2 Block 2"
assert parse_markdown_file(self.file_name, file_text) == StreamFile(
filename=self.file_name,
@ -104,4 +104,26 @@ class TestParseProcess:
),
],
),
)
)
def test_parse_split_paragraph_with_inner_tags_at_more_positions(self):
file_text = "Hello @Tag1 World!\n\n@Marker Block 1\n\nBlock 2 @Tag2"
assert parse_markdown_file(self.file_name, file_text) == StreamFile(
filename=self.file_name,
shard=Shard(
markers=[],
tags=["Tag1", "Tag2"],
start_line=1,
end_line=5,
children=[
Shard(
markers=["Marker"],
tags=[],
start_line=3,
end_line=3,
children=[],
),
],
),
)