Skip to content

Commit ef1cd5a

Browse files
feat: MarkX prefers [IO.File]::Exists ( Fixes #42 )
1 parent de727bf commit ef1cd5a

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

Types/MarkX/Sync.ps1

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,10 @@ $allMarkdown = @(:nextInput foreach ($md in $this.Input) {
106106
}
107107

108108
if ($md -match '(?>\.md|markdown)$' -and
109-
(Test-Path $md -ErrorAction Ignore)
109+
(
110+
[IO.File]::Exists("$md") -or
111+
(Test-Path $md -ErrorAction Ignore)
112+
)
110113
) {
111114
$md = Get-Content -Raw $md
112115
}
@@ -132,7 +135,7 @@ $allMarkdown = @(foreach ($md in $allMarkdown) {
132135
if ($md -match '^---') {
133136
$null, $yamlheader, $restOfMakdown = $md -split '---', 3
134137
if ($yamlheader) {
135-
$yamlHeaders+= $yamlheader
138+
$yamlHeaders+= $yamlheader
136139
}
137140
$restOfMakdown
138141
} else {

0 commit comments

Comments
 (0)