Skip to content

Commit db4bf44

Browse files
committed
Use regex replace to make sure only the correct parts are replaced
1 parent 5c9c154 commit db4bf44

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

.github/workflows/preview-build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -526,9 +526,9 @@ jobs:
526526
const toLink = (file) => {
527527
console.log('file', file);
528528
const path = file
529-
.replace('docs/', '')
530-
.replace('/index.md', '')
531-
.replace('.md', '');
529+
.replace(/^docs\//, '')
530+
.replace(/\/index.md$/, '')
531+
.replace(/\.md$/, '');
532532
return `[${file}](https://docs-v3-preview.elastic.dev${process.env.PATH_PREFIX}/${path})`;
533533
}
534534

0 commit comments

Comments
 (0)