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

} in code block options #1785

Open
pinage404 opened this issue Jul 27, 2024 · 3 comments
Open

} in code block options #1785

pinage404 opened this issue Jul 27, 2024 · 3 comments
Labels
bug Something isn't working pr welcome

Comments

@pinage404
Copy link

Hi,

Describe the bug

slidev build fails after upgrade with Invalid end tag

Minimal reproduction

Steps to reproduce the behavior:

I did a minimal reproductible test repository https://gitlab.com/pinage404/slidev_broken_upgrade

With this content in a slides.md

<div>

```txt {editorOptions:{lineNumbers:'off'}}
git reset [--soft | --mixed [-N] | --hard | --merge | --keep] [-q]
```

<span v-mark.box>

```txt {editorOptions:{lineNumbers:'off'}}
[<commit>]
```

</span>

</div>

With [email protected], slidev build works
With [email protected], slidev build fails stdout stderr
With [email protected] (current latest), slidev build still fails stdout stderr

Additional context

I'm trying to upgrade this slide (the corresponding code)

Environment

  • Slidev version: 0.49.17 and newer
  • Browser: not relevant, it fails on the build
  • OS: NixOS 24.05.20240725.a1cc729 (Uakari) x86_64

If you are using Slidev globally (i.e. npx slidev or npm i -g slidev), please try to reproduce the issue in a local project (i.e. npm create slidev@latest). I prefer to have a reproductible setup, i avoid globally installed tools that are specific to a project

Thank you for maintaining slidev, it's an amazing project, that evolves really quickly, it's really enjoyable !

@KermanX KermanX added the bug Something isn't working label Jul 27, 2024
@KermanX
Copy link
Member

KermanX commented Jul 27, 2024

I am not sure about the usage of the options in your code. The options seem to be Monaco Editor options, but the code block is a normal code block.

To define a Monaco Editor:

```txt {monaco}{editorOptions:{lineNumbers:'off'}}
git reset [--soft | --mixed [-N] | --hard | --merge | --keep] [-q]
```

To define a code block without line numbers:

```txt {*}{lines:false}
git reset [--soft | --mixed [-N] | --hard | --merge | --keep] [-q]
```

However, the code block transformer does have some problems when there are } inside the option.

@pinage404
Copy link
Author

I am not sure about the usage of the options in your code. The options seem to be Monaco Editor options, but the code block is a normal code block.

This is the way I found to disable it 🤷

Thanks for your comment, it helped me find another solution

Should we close this issue ?

@KermanX
Copy link
Member

KermanX commented Jul 27, 2024

Let's keep the issue open to keep track of the problem of } inside the option. Thank you for letting us know this.

@KermanX KermanX changed the title Upgrading issue starting from 0.49.17 { in code block options Jul 27, 2024
@KermanX KermanX changed the title { in code block options } in code block options Jul 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pr welcome
Projects
None yet
Development

No branches or pull requests

2 participants