From 45f9c0839f64d88f75862c9f2c8e7cc9f81b1088 Mon Sep 17 00:00:00 2001 From: Shichao Zhang Date: Tue, 30 Aug 2022 14:33:14 +0800 Subject: [PATCH 1/3] keep the behavior the same between current host and alternative host (#8155) --- docs/specs/markdown.yml | 3 ++- src/docfx/build/link/LinkResolver.cs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/specs/markdown.yml b/docs/specs/markdown.yml index c06a3850813..6494e1bab89 100644 --- a/docs/specs/markdown.yml +++ b/docs/specs/markdown.yml @@ -862,10 +862,11 @@ outputs: inputs: docfx.yml: | alternativeHostname: new-docs.microsoft.com + removeHostName: true docs/a.md: | [A link](https://new-docs.microsoft.com/en-us/azure) outputs: docs/a.json: | { - "conceptual": "

A link

", + "conceptual": "

A link

", } diff --git a/src/docfx/build/link/LinkResolver.cs b/src/docfx/build/link/LinkResolver.cs index d9afd5df5c4..3ed9a07d7ee 100644 --- a/src/docfx/build/link/LinkResolver.cs +++ b/src/docfx/build/link/LinkResolver.cs @@ -155,7 +155,7 @@ public LinkResolver( return (errors, "", fragment, LinkType.AbsolutePath, null, false); } var resolvedHref = _config.RemoveHostName ? UrlUtility.RemoveLeadingHostName(href, _config.HostName) : href; - resolvedHref = UrlUtility.RemoveLeadingHostName(resolvedHref, _config.AlternativeHostName, true); + resolvedHref = _config.RemoveHostName ? UrlUtility.RemoveLeadingHostName(resolvedHref, _config.AlternativeHostName) : resolvedHref; return (errors, resolvedHref, fragment, LinkType.AbsolutePath, null, false); } From 361e4cf72d0f3bfb92b35805f9c1604d626b48ef Mon Sep 17 00:00:00 2001 From: Min Huang Date: Tue, 30 Aug 2022 16:14:23 +0800 Subject: [PATCH 2/3] bump EcmaHelper to 1.2.2067.77 (#8154) --- src/docfx/docfx.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/docfx/docfx.csproj b/src/docfx/docfx.csproj index 95e092be2a1..e25a4b113d5 100644 --- a/src/docfx/docfx.csproj +++ b/src/docfx/docfx.csproj @@ -22,7 +22,7 @@ - + From 4c97cf48c876ae89b42e945690faebe2e1a11523 Mon Sep 17 00:00:00 2001 From: Shichao Zhang Date: Tue, 30 Aug 2022 16:25:56 +0800 Subject: [PATCH 3/3] fix the support of alternative host (#8157) --- src/docfx/build/link/LinkResolver.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/docfx/build/link/LinkResolver.cs b/src/docfx/build/link/LinkResolver.cs index 3ed9a07d7ee..386a28fef48 100644 --- a/src/docfx/build/link/LinkResolver.cs +++ b/src/docfx/build/link/LinkResolver.cs @@ -155,7 +155,7 @@ public LinkResolver( return (errors, "", fragment, LinkType.AbsolutePath, null, false); } var resolvedHref = _config.RemoveHostName ? UrlUtility.RemoveLeadingHostName(href, _config.HostName) : href; - resolvedHref = _config.RemoveHostName ? UrlUtility.RemoveLeadingHostName(resolvedHref, _config.AlternativeHostName) : resolvedHref; + resolvedHref = UrlUtility.RemoveLeadingHostName(resolvedHref, _config.AlternativeHostName); return (errors, resolvedHref, fragment, LinkType.AbsolutePath, null, false); }