From 542036b3b36bb676fcb2319edc33e1eb9484a481 Mon Sep 17 00:00:00 2001 From: Ceceliachenen Date: Wed, 11 Dec 2024 10:34:11 +0800 Subject: [PATCH] fix markdown parser (#305) --- src/pai_rag/integrations/nodeparsers/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pai_rag/integrations/nodeparsers/base.py b/src/pai_rag/integrations/nodeparsers/base.py index 7884a22c..2184edfa 100644 --- a/src/pai_rag/integrations/nodeparsers/base.py +++ b/src/pai_rag/integrations/nodeparsers/base.py @@ -136,7 +136,7 @@ def _build_nodes_from_split( ref_doc = ref_doc or node relationships = {NodeRelationship.SOURCE: ref_doc.as_related_node_info()} image_urls_positions = [] - current_section = current_section.replace(" ", "").strip() + current_section = current_section.strip() raw_section_without_image = current_section for match in re.finditer(IMAGE_URL_PATTERN, current_section): alt_text = match.group("alt_text")