From 134d872ca6f81fafed3a8f880d6e05877c9680ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Mart=C3=ADnez=20Portela?= Date: Mon, 22 Jul 2024 23:31:19 +0100 Subject: [PATCH] wip: First approach to get going. --- org_rw/org_rw.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/org_rw/org_rw.py b/org_rw/org_rw.py index c0a1244..2120011 100644 --- a/org_rw/org_rw.py +++ b/org_rw/org_rw.py @@ -772,6 +772,20 @@ class Headline: else: raise NotImplementedError() + def update_raw_contents(self, new_contents): + # @TODO: Properly re-parse elements + self.keywords = [] + self.contents = [] + self.list_items = [] + self.table_rows = [] + self.properties = [] + self.structural = [] + self.delimiters = [] + for line in new_contents.split('\n'): + self.contents.append( + RawLine(linenum=0, line=line) + ) + def get_element_in_line(self, linenum): for line in self.contents: if linenum == line.linenum: