echonesis commented on code in PR #297:
URL: https://github.com/apache/ozone-site/pull/297#discussion_r2744307563


##########
docusaurus.config.js:
##########
@@ -112,6 +112,59 @@ const config = {
 
       return result;
     },
+    /*
+    Validate internal markdown links to ensure they don't contain number 
prefixes or file extensions.
+    These can break when the ordering or format of the target page is updated.
+    Docusaurus can resolve links without these.
+    See https://docusaurus.io/docs/api/docusaurus-config#markdown for 
reference.
+    */
+    preprocessor: (/** @type {{filePath: string, fileContent: string}} */ 
params) => {
+      const {filePath, fileContent} = params;
+
+      // Validate internal links format
+      const internalLinkPattern = /\[([^\]]+)\]\(([^)]+\.md(?:#[^)]+)?)\)/g;

Review Comment:
   This would break image links like `![diagram](./architecture.png)`. 
   Should we only block `.md` and `.mdx` extensions instead?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to