Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions nbdev/doclinks.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ def link_line(self, l): return _re_backticks.sub(self._link_sym, l)

def linkify(self, md):
if md:
if isinstance(md,list): md = ''.join(md)
in_fence=False
lines = md.splitlines()
for i,l in enumerate(lines):
Expand Down
12 changes: 12 additions & 0 deletions nbs/api/05_doclinks.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -726,6 +726,7 @@
"\n",
" def linkify(self, md):\n",
" if md:\n",
" if isinstance(md,list): md = ''.join(md)\n",
" in_fence=False\n",
" lines = md.splitlines()\n",
" for i,l in enumerate(lines):\n",
Expand Down Expand Up @@ -1046,6 +1047,17 @@
"assert NbdevLookup().linkify(md) == md"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "f3a1b2c4",
"metadata": {},
"outputs": [],
"source": [
"# Outputs read from disk may store markdown as a list of lines\n",
"test_eq(NbdevLookup().linkify(['a\\n','b']), 'a\\nb')"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down
Loading