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


##########
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:
   Good catch. Can we exclude this check for image links for now by checking 
for their format beginning with an exclamation point `![]()`? Our image 
management is a little messy right now. I'd like to clean it up in a follow-up 
task where we can refine this check.



-- 
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