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

Replacing "$&" in codeblock lang with "{0}" #6074

Closed
0xdf223 opened this issue Jun 11, 2024 · 1 comment
Closed

Replacing "$&" in codeblock lang with "{0}" #6074

0xdf223 opened this issue Jun 11, 2024 · 1 comment
Labels

Comments

@0xdf223
Copy link

0xdf223 commented Jun 11, 2024


Describe the bug
I use Typora to generate markdown for a Jekyll website, which uses the Rouge formatter for codeblocks. This leads me to a lot of code blocks that use the console language, which takes arguments like prompt, lang, and output. That leads to codeblocks that have the first line:

```console?prompt=$&lang=bash&output=python
$cat test.py
#!/usr/bin/env python3

print("hello world")
```

When I save this in Typora, the "$&" gets replaced as {0}, which breaks everything downstream.

To Reproduce
Steps to reproduce the behavior:

  1. In any document, create a codeblock with a language like the one above
    image
  2. Save it.
  3. View the raw markdown outside of Typora:
$ cat test.md 
```console?prompt={0}output=php
test
```

Expected behavior
The text should still be prompt=$&output=php.

Desktop (please complete the following information):

  • OS: Ubuntu 23.04
  • OS: Windows 11

Typora Version
e.g: 1.8.10

@abnerlee abnerlee added the bug label Jun 20, 2024
@abnerlee
Copy link
Contributor

abnerlee commented Jun 25, 2024

fixed in 1.9.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants