From b0c828cdbf84fb30061a736117f9d6f65f8b9b18 Mon Sep 17 00:00:00 2001 From: Gleb Alekseev Date: Wed, 9 Feb 2022 12:35:28 +0300 Subject: [PATCH] Fix legend items broken links Now legend is generated supposing that tests from different js files are located in different .md files. It gives links like https://localhost/linked-file But is not right. Everything is located in one md, so links must be in the form of https://localhost/#linked-file --- lib/docha.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/docha.js b/lib/docha.js index 4263281..5f8eaac 100644 --- a/lib/docha.js +++ b/lib/docha.js @@ -142,7 +142,7 @@ function buildLegend(options, block, depth){ if (block.block){ var url = prefix + block.block.toLowerCase().split(' ').join('-'); - return Array(depth).join(' ') + '* [' + block.block + '](' + url + ')\n' + + return Array(depth).join(' ') + '* [' + block.block + '](#' + url + ')\n' + block.children.map(function(child){ return buildLegend(options, child, depth + 1); }).join('');