From: Lady Date: Wed, 23 Aug 2023 19:15:59 +0000 (-0400) Subject: Basic support for subpages X-Git-Tag: 0.3.0~3 X-Git-Url: https://git.ladys.computer/GitWikiWeb/commitdiff_plain/06d2bfe7fc9b1319467b9d71151dc8b5362f7384 Basic support for subpages Practically, this just allows `/` in page names. More advanced functionality to come at a later time. --- diff --git a/build.js b/build.js index 3d3a862..0eb61fd 100644 --- a/build.js +++ b/build.js @@ -147,8 +147,8 @@ const logErrorsAndCollectResults = (results) => }); const getReferenceFromPath = (path) => - /Sources\/([A-Z][0-9A-Za-z]*\/[A-Z][0-9A-Za-z]*)\.djot$/u.exec(path) - ?.[1]?.replace?.("/", ":"); + /Sources\/([A-Z][0-9A-Za-z]*(?:\/[A-Z][0-9A-Za-z]*)+)\.djot$/u + .exec(path)?.[1]?.replace?.("/", ":"); // only replaces first slash const listOfInternalLinks = (references, wrapper = ($) => $) => ({ tag: "bullet_list", @@ -331,7 +331,7 @@ class GitWikiWebPage { e.attributes ??= {}; const { attributes, reference, destination } = e; if ( - /^(?:[A-Z][0-9A-Za-z]*|[@#])?:(?:[A-Z][0-9A-Za-z]*)?$/u + /^(?:[A-Z][0-9A-Za-z]*|[@#])?:(?:[A-Z][0-9A-Za-z]*(?:\/[A-Z][0-9A-Za-z]*)*)?$/u .test(reference ?? "") ) { const [namespacePrefix, pageName] = splitReference(