hello there, I am trying to replace text within a node of a markdown document however having some trouble. Is there anything wrong with the code below? the text are just not changed.
sample document:
# A
- text for A
# B
- text for b
code:
from llama_index.core.node_parser import MarkdownNodeParser
parser = MarkdownNodeParser()
for page in document:
page_nodes = parser.get_nodes_from_documents([page])
for node in page_nodes:
if node.metadata['Header_1'] == 'B':
node.text = 'New text for B'
print(node.text) # text is changed
print(page.text) # text is not changed!