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

🐞 Matching ${...} in shell script code blocks #35

Open
3 of 7 tasks
ChristinWhite opened this issue Mar 27, 2024 · 0 comments
Open
3 of 7 tasks

🐞 Matching ${...} in shell script code blocks #35

ChristinWhite opened this issue Mar 27, 2024 · 0 comments

Comments

@ChristinWhite
Copy link

ChristinWhite commented Mar 27, 2024

Check for existing bug reports before submitting.

  • I searched for existing Bug Reports and found no similar reports.

Expected Behavior

The expected behavior is that Markdown Attributes would not match in any code blocks and we'd see something like this:

CleanShot 2024-03-26 at 17 46 22@2x

Current behaviour

However, when Markdown Attributes is enabled it matches {TERM} and hides that section of code:

CleanShot 2024-03-26 at 17 45 11@2x

I believe this is distinct from #5 because it's contextually specific based upon the language the code block is using. Of all the languages I've tried the only time it matches the {TERM} string and hides it is using sh, bash and zsh. As you can see, it is behaving normally when no language is present, it also does not happen for JS, Python, C, Go, Rust and about a dozen other alternatives that I tried.

As far as I can tell, it also only matches if it's preceded by a $ so I suspect this might be an regex error though it's strange that it only happens in shell blocks.

This only happens in live preview mode, reading mode appears normal. I've also disabled every other plugin (including editor syntax highlighting) and snippet to rule out incompatibility with another modification.

Reproduction

  1. Enable Markdown Attributes
  2. Create a code block
  3. Set the syntax to sh
  4. Add a line that includes $ followed by { ... } anywhere in the code block, even on new lines.

Here is the specific code I used in the screenshots:

```
if [ "${TERM}" = xterm ]; then TERM=xterm-256color; fi
```

```sh
if [ "${TERM}" = xterm ]; then TERM=xterm-256color; fi
```

Which Operating Systems are you using?

  • Android
  • iPhone/iPad
  • Linux
  • macOS
  • Windows

Obsidian Version Check

1.5.11

Plugin Version

1.2.2

Confirmation

  • I have disabled all other plugins and the issue still persists.

Possible solution

No response

@ChristinWhite ChristinWhite changed the title 🐞 Matching {...} in shell script code blocks 🐞 Matching ${...} in shell script code blocks Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant