Skip to content

Commit

Permalink
fix: should slash paths in exported Markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
KermanX committed Aug 24, 2024
1 parent 5161b93 commit da520c3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/slidev/node/commands/export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import process from 'node:process'
import fs from 'fs-extra'
import { blue, cyan, dim, green, yellow } from 'kolorist'
import { Presets, SingleBar } from 'cli-progress'
import { clearUndefined } from '@antfu/utils'
import { clearUndefined, slash } from '@antfu/utils'
import { parseRangeString } from '@slidev/parser/core'
import type { ExportArgs, ResolvedSlidevOptions, SlideInfo, TocItem } from '@slidev/types'
import { outlinePdfFactory } from '@lillallol/outline-pdf'
Expand Down Expand Up @@ -452,7 +452,7 @@ export async function exportSlides({
const files = await fs.readdir(output)
const mds: string[] = files.map((file, i, files) => {
const slideIndex = getSlideIndex(file)
const mdImg = `![${slides[slideIndex]?.title}](./${path.join(output, file)})\n\n`
const mdImg = `![${slides[slideIndex]?.title}](./${slash(path.join(output, file))})\n\n`
if ((i + 1 === files.length || getSlideIndex(files[i + 1]) !== slideIndex) && slides[slideIndex]?.note)
return `${mdImg}${slides[slideIndex]?.note}\n\n`
return mdImg
Expand Down

0 comments on commit da520c3

Please sign in to comment.