Compare commits

..

1 Commits

Author SHA1 Message Date
Sergio Martínez Portela
3be4475ddf Support get_raw_contents of list groups. 2022-11-03 23:01:21 +01:00

View File

@ -1,10 +1,8 @@
import uuid
from .org_rw import (Bold, Code, Headline, Italic, Line, RawLine, ListItem, Strike, Text,
from .org_rw import (Bold, Code, Headline, Italic, Line, RawLine, Strike, Text,
Underlined, Verbatim)
from .org_rw import dump_contents
def get_hl_raw_contents(doc: Headline) -> str:
lines = []
@ -38,8 +36,6 @@ def get_raw_contents(doc) -> str:
return "".join([get_raw_contents(chunk) for chunk in doc])
if isinstance(doc, (Text, Bold, Code, Italic, Strike, Underlined, Verbatim)):
return doc.get_raw()
if isinstance(doc, ListItem):
return dump_contents(doc)[1]
print("Unhandled type: " + str(doc))
raise NotImplementedError("Unhandled type: " + str(doc))