From 3dc6213abba9ac86991797e5ac5019008f4bdc62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Mart=C3=ADnez=20Portela?= Date: Thu, 29 Sep 2022 20:31:23 +0200 Subject: [PATCH] Handle list items where the tag is composed only by the checkbox. --- org_rw/org_rw.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/org_rw/org_rw.py b/org_rw/org_rw.py index fce9f4f..b806538 100644 --- a/org_rw/org_rw.py +++ b/org_rw/org_rw.py @@ -88,7 +88,7 @@ PLANNING_RE = re.compile( r")+\s*" ) LIST_ITEM_RE = re.compile( - r"(?P\s*)((?P[*\-+])|((?P\d|[a-zA-Z])(?P[.)]))) ((?P)\[(?P[ Xx])\])?((?P\s*)(?P.*?)::)?(?P.*)" + r"(?P\s*)((?P[*\-+])|((?P\d|[a-zA-Z])(?P[.)]))) ((?P\s*)\[(?P[ Xx])\])?((?P\s*)(?P.*?)::)?(?P.*)" ) # Org-Babel @@ -1525,7 +1525,7 @@ def dump_contents(raw): bullet = raw.bullet if raw.bullet else raw.counter + raw.counter_sep content = token_list_to_raw(raw.content) checkbox = f"[{raw.checkbox_value}]" if raw.checkbox_value else "" - tag = f"{raw.tag_indentation}{token_list_to_raw(raw.tag)}::" if raw.tag else "" + tag = f"{raw.tag_indentation}{token_list_to_raw(raw.tag or '')}::" if raw.tag or raw.tag_indentation else "" return ( raw.linenum, f"{raw.indentation}{bullet} {checkbox}{tag}{content}",