Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom themes are not displayed after export if only .md file is open #418

Open
taunnol opened this issue May 20, 2023 · 1 comment
Open
Labels
bug Something isn't working

Comments

@taunnol
Copy link

taunnol commented May 20, 2023

How to reproduce:

  1. Open your .md file with presentation, not a whole project folder
  2. Add a custom theme, specify the relative path to it in the settings
  3. Theme will be displayed in preview
  4. Export in any format
  5. The exported presentation has a default theme, no errors appear in the console

This is very confusing, since the theme is visible in the preview, and the pictures (also relative) work great.

@yhatt yhatt added the bug Something isn't working label May 20, 2023
@yhatt
Copy link
Member

yhatt commented May 20, 2023

Thanks! I guess this is a misdetection of the base directory for the specified relative path when exporting Markdown via Marp CLI.

marp-vscode/src/option.ts

Lines 102 to 110 in 5dbd243

const workspaceFolder = workspace.getWorkspaceFolder(uri)
const parentFolder = uri.scheme === 'file' && path.dirname(uri.fsPath)
const baseFolder = (() => {
if (workspaceFolder) return workspaceFolder.uri
if (parentFolder) return Uri.parse(`file:${parentFolder}`, true)
return undefined
})()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Todo
Development

No branches or pull requests

2 participants