Sync eng/common directory with azure-sdk-tools for PR 9177 (#1913)
* Escape parentheses in includes to fix issues in publishing * Only escape close parens * Comments --------- Co-authored-by: Daniel Jurek <djurek@microsoft.com>
This commit is contained in:
Родитель
d3279c3aa2
Коммит
229f771156
|
@ -11,8 +11,17 @@ function create-service-readme(
|
|||
$readmePath = Join-Path $readmeFolder -ChildPath $readmeName
|
||||
$content = ""
|
||||
if (Test-Path (Join-Path $readmeFolder -ChildPath $indexTableLink)) {
|
||||
# Escape the close parentheses in the URL. This is required by docs
|
||||
# https://github.com/Azure/azure-sdk-tools/issues/5433
|
||||
# This line looks incorrect but the left parameter is a regex and must
|
||||
# escape the parentheses. The right is a literal string and, since this is
|
||||
# PowerShell, the backslash does not itself need to be escaped.
|
||||
|
||||
# Example: "filename-with-(parens).md" -> "filename-with-(parens\).md"
|
||||
$escapedIndexTableLink = $indexTableLink -replace '\)', '\)'
|
||||
|
||||
$content = "## Packages - $moniker`r`n"
|
||||
$content += "[!INCLUDE [packages]($indexTableLink)]"
|
||||
$content += "[!INCLUDE [packages]($escapedIndexTableLink)]"
|
||||
}
|
||||
if (!$content) {
|
||||
LogError "There are no packages under service '$serviceName'. "
|
||||
|
|
Загрузка…
Ссылка в новой задаче