From 299a563a7bb8be16a20e4c8afb6580e92620ec67 Mon Sep 17 00:00:00 2001 From: Kai Cataldo Date: Mon, 26 Sep 2016 17:57:33 -0400 Subject: [PATCH] Build: Do not strip .md extension from absolute URLs (#7222) --- Makefile.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.js b/Makefile.js index 1180196aa30..c626aa71979 100644 --- a/Makefile.js +++ b/Makefile.js @@ -658,8 +658,8 @@ target.gensite = function(prereleaseVersion) { text = "---\ntitle: " + title + "\nlayout: doc\n---\n\n\n" + text; } - // 6. Remove .md extension for links and change README to empty string - text = text.replace(/\.md(.*?\))/g, ")").replace("README.html", ""); + // 6. Remove .md extension for relative links and change README to empty string + text = text.replace(/\((?!https?:\/\/)(.*?)\.md.*?\)/g, "($1)").replace("README.html", ""); // 7. Check if there's a trailing white line at the end of the file, if there isn't one, add it if (!/\n$/.test(text)) {