From 2b69ae25f3f6d5e49e9758c1dd6bf472b5b57b0f Mon Sep 17 00:00:00 2001 From: Alex Calderwood Date: Tue, 19 Oct 2021 20:27:17 -0700 Subject: [PATCH 1/2] untwee [Fix] Regex issue in untwee. --- untwee | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/untwee b/untwee index 71745fb..a25d775 100755 --- a/untwee +++ b/untwee @@ -16,7 +16,10 @@ def main (argv): file = open(argv[0]) tw = TiddlyWiki() - tw.addHtml(file.read()) + data = file.read() + # print data + tw.addHtml(data) + # print tw print tw.toTwee() From efd2f85195089a1cb4470f1eab3121ac0809b116 Mon Sep 17 00:00:00 2001 From: Alex Calderwood Date: Tue, 19 Oct 2021 20:31:20 -0700 Subject: [PATCH 2/2] [Fix] Applied the fix mentioned in the last commit - fix regex that was too tight and not matching on the divs. --- lib/tiddlywiki.py | 7 ++++--- untwee | 1 - 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/tiddlywiki.py b/lib/tiddlywiki.py index 38d5c47..21c2730 100644 --- a/lib/tiddlywiki.py +++ b/lib/tiddlywiki.py @@ -135,10 +135,11 @@ def addTwee (self, source): def addHtml (self, source): """Adds HTML source code to this TiddlyWiki.""" - divs_re = re.compile(r'
(.*)
\s*', - re.DOTALL) + divs_re = re.compile( + r'
', + re.DOTALL + ) divs = divs_re.search(source) - if divs: for div in divs.group(1).split('