Skip to content

Commit 684678a

Browse files
committed
check for colon in md yaml
1 parent ebae228 commit 684678a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

nbdev/frontmatter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def _md2dict(s:str):
2929
res = {'title': m.group(1)}
3030
m = re.search(r'^>\s+(\S.*?)\s*$', s, flags=re.MULTILINE)
3131
if m: res['description'] = m.group(1)
32-
r = re.findall(r'^-\s+(\S.*?)\s*$', s, flags=re.MULTILINE)
32+
r = re.findall(r'^-\s+(\S.*:.*\S)\s*$', s, flags=re.MULTILINE)
3333
if r:
3434
try: res.update(yaml.safe_load('\n'.join(r)))
3535
except Exception as e: warn(f'Failed to create YAML dict for:\n{r}\n\n{e}\n')

nbs/09a_frontmatter.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
" res = {'title': m.group(1)}\n",
8484
" m = re.search(r'^>\\s+(\\S.*?)\\s*$', s, flags=re.MULTILINE)\n",
8585
" if m: res['description'] = m.group(1)\n",
86-
" r = re.findall(r'^-\\s+(\\S.*?)\\s*$', s, flags=re.MULTILINE)\n",
86+
" r = re.findall(r'^-\\s+(\\S.*:.*\\S)\\s*$', s, flags=re.MULTILINE)\n",
8787
" if r:\n",
8888
" try: res.update(yaml.safe_load('\\n'.join(r)))\n",
8989
" except Exception as e: warn(f'Failed to create YAML dict for:\\n{r}\\n\\n{e}\\n')\n",

0 commit comments

Comments
 (0)