Skip to content

Commit effa1ee

Browse files
authored
Merge pull request #1218 from seeM/fix-1210
fix regex in `nbdev.doclinks._nbpath2html`
2 parents d1ba421 + c9fe8e1 commit effa1ee

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

nbdev/doclinks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def _iter_py_cells(p):
5858
yield AttrDict(nb=nb, idx=int(idx), code=code, nb_path=nb_path, py_path=p.resolve())
5959

6060
# %% ../nbs/api/doclinks.ipynb 11
61-
def _nbpath2html(p): return p.with_name(re.sub(r'\d+[a-zA-Z0-9]+_', '', p.name.lower())).with_suffix('.html')
61+
def _nbpath2html(p): return p.with_name(re.sub(r'^\d+[a-zA-Z0-9]*_', '', p.name.lower())).with_suffix('.html')
6262

6363
# %% ../nbs/api/doclinks.ipynb 13
6464
def _get_modidx(py_path, code_root, nbs_path):

nbs/api/doclinks.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@
165165
"outputs": [],
166166
"source": [
167167
"#|export\n",
168-
"def _nbpath2html(p): return p.with_name(re.sub(r'\\d+[a-zA-Z0-9]+_', '', p.name.lower())).with_suffix('.html')"
168+
"def _nbpath2html(p): return p.with_name(re.sub(r'^\\d+[a-zA-Z0-9]*_', '', p.name.lower())).with_suffix('.html')"
169169
]
170170
},
171171
{

0 commit comments

Comments
 (0)