Skip to content

Commit 65f6fa8

Browse files
committed
fixes #3
1 parent af1726b commit 65f6fa8

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

00_xml.ipynb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@
178178
"#| exports\n",
179179
"def _add_nls(s):\n",
180180
" \"Add newlines to start and end of `s` if missing\"\n",
181+
" if not s: return s\n",
181182
" if s[ 0]!='\\n': s = '\\n'+s\n",
182183
" if s[-1]!='\\n': s = s+'\\n'\n",
183184
" return s"
@@ -316,7 +317,7 @@
316317
"<document index=\"1\">\n",
317318
" <source>\n",
318319
"b8898fab\n",
319-
"</source>\n",
320+
"\n",
320321
" <document_content>\n",
321322
"This is a sample\n",
322323
"</document_content>\n",
@@ -372,15 +373,15 @@
372373
" <document index=\"1\">\n",
373374
" <source>\n",
374375
"b8898fab\n",
375-
"</source>\n",
376+
"\n",
376377
" <document_content>\n",
377378
"This is a sample\n",
378379
"</document_content>\n",
379380
" </document>\n",
380381
" <document index=\"2\">\n",
381382
" <source>\n",
382383
"doc.txt\n",
383-
"</source>\n",
384+
"\n",
384385
" <document_content>\n",
385386
"And another one\n",
386387
"</document_content>\n",

settings.ini

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[DEFAULT]
22
repo = toolslm
33
lib_name = toolslm
4-
version = 0.0.4
4+
version = 0.0.5
55
min_python = 3.9
66
license = apache2
77
black_formatting = False
@@ -35,3 +35,5 @@ clean_ids = True
3535
clear_all = False
3636
conda_user = fastai
3737
console_scripts = folder2ctx=toolslm.xml:folder2ctx_cli
38+
cell_number = True
39+

toolslm/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.0.4"
1+
__version__ = "0.0.5"

toolslm/xml.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def build_xml(data, parent):
3737
# %% ../00_xml.ipynb 11
3838
def _add_nls(s):
3939
"Add newlines to start and end of `s` if missing"
40+
if not s: return s
4041
if s[ 0]!='\n': s = '\n'+s
4142
if s[-1]!='\n': s = s+'\n'
4243
return s

0 commit comments

Comments
 (0)