diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2023-03-26 08:42:14 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2023-03-26 08:42:14 -0300 |
commit | 4e6f3c16818d9beb200c337d48c8ae2470a322ee (patch) | |
tree | b05bc1f5df177572bdf61eb32d0c34823d010ce1 /src | |
parent | 5dfdb661c4672bcf432c9bd283a2ffec5a3c1cb3 (diff) |
data steps: linkTemplate snapshot tests
Diffstat (limited to 'src')
-rw-r--r-- | src/content-function.js | 6 | ||||
-rw-r--r-- | src/content/dependencies/linkTemplate.js | 5 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/content-function.js b/src/content-function.js index 0a217800..377eecc9 100644 --- a/src/content-function.js +++ b/src/content-function.js @@ -279,7 +279,9 @@ export function flattenRelationsTree({ } } - recursive(relationsTree); + if (relationsTree) { + recursive(relationsTree); + } return { root, @@ -335,7 +337,7 @@ export function quickEvaluate({ extraDependencies: allExtraDependencies, name, - args, + args = [], }) { const treeInfo = getRelationsTree(allContentDependencies, name, ...args); const flatTreeInfo = flattenRelationsTree(treeInfo); diff --git a/src/content/dependencies/linkTemplate.js b/src/content/dependencies/linkTemplate.js index 94b90652..acac99be 100644 --- a/src/content/dependencies/linkTemplate.js +++ b/src/content/dependencies/linkTemplate.js @@ -26,7 +26,10 @@ export default { } if (appendIndexHTML) { - if (/^(?!https?:\/\/).+\/$/.test(href)) { + if ( + /^(?!https?:\/\/).+\/$/.test(href) && + href.endsWith('/') + ) { href += 'index.html'; } } |