From 356223ecbcdbd560992b3f2ce4ae0b99ed191388 Mon Sep 17 00:00:00 2001 From: Nathan Cooper Date: Tue, 7 Jul 2026 21:19:06 -0400 Subject: [PATCH] Fix linkify for list-form markdown outputs Co-Authored-By: Claude Fable 5 --- nbdev/doclinks.py | 1 + nbs/api/05_doclinks.ipynb | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/nbdev/doclinks.py b/nbdev/doclinks.py index 09a9104c1..f2183dbd5 100644 --- a/nbdev/doclinks.py +++ b/nbdev/doclinks.py @@ -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): diff --git a/nbs/api/05_doclinks.ipynb b/nbs/api/05_doclinks.ipynb index 53541cad6..a8311e93d 100644 --- a/nbs/api/05_doclinks.ipynb +++ b/nbs/api/05_doclinks.ipynb @@ -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", @@ -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,