Skip to content

Commit 1365897

Browse files
committed
Fixed an issue where inline code samples on mslearn weren't generated when [ToolkitSample(somevalue)] is instead of [ToolkitSample(id: somevalue)]
1 parent 58649b8 commit 1365897

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Build-Toolkit-Docs.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function ProcessMarkdownFile($markdownFile) {
3737

3838
# Insert Header
3939
$contents = $contents.Substring(0, $endIndex + 5) + "`n# $header`n" + $contents.Substring($endIndex + 5)
40-
40+
4141
# Find Sample Placeholders, replace with code content
4242
foreach ($sample in ($contents | Select-String -Pattern '>\s*\[!SAMPLE\s*(?<sampleid>.*)\s*\]\s*' -AllMatches).Matches) {
4343
$sampleid = $sample.Groups[1].Value
@@ -47,8 +47,8 @@ function ProcessMarkdownFile($markdownFile) {
4747
foreach ($csFile in Get-ChildItem -Recurse -Path ($markdownFile.DirectoryName + '\**\*.xaml.cs').Replace('\', '/') |
4848
Where-Object { $_.FullName -notlike "*\bin\*" -and $_FullName -notlike "*\obj\*" }) {
4949
$csSample = Get-Content $csFile -Raw
50-
51-
if ($csSample -match '\[ToolkitSample\s?\(\s*id:\s*(?:"|nameof\()\s?' + $sampleid + '\s?(?:"|\))') {
50+
51+
if ($csSample -match '\[ToolkitSample\s?\(\s*(?:id\:)?\s*(?:"|nameof\()\s?' + $sampleid + '\s?(?:"|\))') {
5252
# Get Relative Path
5353
$docPath = $(Join-Path "components" $($csfile.FullName.Replace($componentsRoot.Path, ''))).Replace('\', '/').Trim('/')
5454

0 commit comments

Comments
 (0)